Search the Community
Showing results for tags 'perl'.
Found 5 results
-
Regex - Run and save regular expressions!
Matthew Lancellotti posted a topic in Share your Workflows
Perform a search and replace on copied text, and save regexs for future use. Download: http://code.instructorium.com/downloads/Regex.alfredworkflow Please visit http://code.instructorium.com/regex for more information. (also on Packal: http://www.packal.org/workflow/regex ) A summary is below: Commands you can use: 1. Any regular expression (no keyword necessary, Perl-style) "s/this/that/msg" "s@\$(\d+)\.(\d{2})@$1 dollars and $2 cents@g", etc. 2. Follow your regular expression with " save as " and then a name in order to save it for future use. "s&this&that&xg save as mythisthat", etc. 3. Use the "regex" keyword followed by the name you saved it under to execute a saved regex. "regex mythisthat", etc. As far as I know, it works on all versions of Alfred 2 and all versions of OS X. Your custom workflows are saved under ~/Library/Application Support/Alfred 2/workflows/com.verykiwi.regex/RegexSequences.pl. You can delete the com.verykiwi.regex folder after uninstall. Feel free to contact me if you have any issues. -
For all the Perl programmers, here's a Alfred 3 Workflow that allows you to search MetaCPAN from Alfred and directly open up the documentation for a module. Packal for downloading GitHub for looking at the source (if you care) Have fun. Mark.
-
Here is my problem. I modify a lot of strings cases these last days (ie Lower case to uppercase "my_file" to "MY_FILE"). After some research, I found I could use these TextExpander perl scripts (here) to solve the problem. But I believed Alfred could make it faster, better, smoother. What I want to do is select the name of my file, hit a hotkey, see the name of my file converted to uppercase/lowercase/sentence case... I tried to create a workflow with a "Selection in OSX" and a "Run Script" command. But it doesn't work. I should say, I couldn't make it work... I thought copying these perl script in a run script action would be enough. Here are the for Perl scripts I am referring to : 1°) Paste clipboard to lower Case #!/usr/bin/perl -w #Initialise use strict; my($text); #Get the text from the clipboard $text =`pbpaste`; #Output the text as lowercase print "\L$text"; 2°) Paste clipboard to Upper Case #!/usr/bin/perl -w #Initialise use strict; my($text); #Get the text from the clipboard $text =`pbpaste`; #Output the text as uppercase print "\U$text"; 3°) Paste clipboard to Sentence Case #!/usr/bin/perl -w #Initialise use strict; my($text); #Get the text from the clipboard $text =`pbpaste`; #Convert the text to lower case $text ="\L$text"; #Convert the first character of each sentence to upper case $text =~ s/(^\w|\.\s+\w)/\U$1\E/g; #Output the text print $text; 4°) Paste clipboard to Title/Proper Case #!/usr/bin/perl -w #Initialise use strict; my($text); #Get the text from the clipboard $text =`pbpaste`; #Convert the text to lower case $text ="\L$text"; #Convert the first character of each word to upper case $text =~ s/ ((^\w)|(\s\w))/\U$1/xg; #Output the text print $text; I might be stuck in the escaping settings as I do not really understand what escaping mean in the context of an Alfred workflow.
-
Hello everybody. I am designing a workflow that will allow you to compile / interpret / execute code from most common languages, and then view output, copy to clipboard, or open in a new document. What I would like to ask is what sort of features would you like to have? This is meant to be useful and convenient for you. I will post up the workflow in progress soon. Feedback and feature requests are greatly appreciated! -Matthew
-
I've created a workflow for searching the Metacpan. This allows quick lookup of perl modules that are stored on the cpan. Download the workflow here... http://gordolio.com/mcsuggest In order to use this module you'll need to install the required cpan modules Run this command in your terminal sudo cpan JSON Time::HiRes XML::LibXML LWP::UserAgentCredit goes to the contributors to Metacpan for building such an awesome site.