Perl invocation options

February 23, 2012
perl Technology

I have known about perl invocation options for a while, and I have used them on several occasions. However, I’m not sure I understood just how far the rabbit hole goes.

Try the following: [sourcecode language=“perl”] perl -wnle ‘print “Each line of the file is printed here $_”;’ foo #Process through each line. perl -wpie ’s/replace/with/g;’ foo # sed -i replacement perl -wnlae ‘print $F[0]’ foo # awk ‘{print $1}’ replacement [/sourcecode]

The best part is that these go beyond just replacing existing shell commands because of all the powerful constructs that exist in perl. If you are interested in more of the same, check out the linked book. Now if you will excuse me I am going to go follow the white rabbit…

http://www.amazon.com/Minimal-Perl-UNIX-Linux-People/dp/1932394508/ref=sr_1_1?ie=UTF8&qid=1329999439&sr=8-1

Agile vs Agile

April 1, 2013
programming Technology

Processing multiple queries with Perl DBI and mysql

July 6, 2010
DBI perl perl modules Perl::DBI

Perl SOAP::Lite Example

May 28, 2010
API perl perl modules SOAP SOAP::Lite Technology