perl - what are you on about?
me - you've led me so deep in the mire how are either of us to know?
use lib '.';
use soandso;
there happens to be a dirth of package soandso anywhere yet we merrily
+ whizz along
I've been working on an exercise to generate the English "Twelve
days of Christmas song". So far, I've come up with the following:
for(<DATA>){s/%/ing/;$_=($i++?$i-1+print"
":a)." $_";print"On the $i",(st,nd,rd)[$i-1]||th," day of Christmas,
my true love gave to me:
",$t=$_.$t}__DATA__
partridge in a pear tree.
turtle doves and
French hens,
call% birds,
golden rings,
geese a-lay%,
swans a-swimm%,
maids a-milk%,
ladies danc%,
lords a-leap%,
pipers pip%,
drummers drumm%,
My script is 343 bytes, which is better than zip and tar+gzip but worse than gzip:
-rw-r--r-- 1 john john 294 May 1 13:29 12days.gz
-rw-r--r-- 1 john john 343 Apr 30 04:00 12days.pl
-rw-r--r-- 1 john john 370 May 1 13:30 12days.tar.gz
-rw-r--r-- 1 john john 2169 May 1 13:29 12days.txt
-rw-r--r-- 1 john john 439 May 1 13:30 12days.zip
I don't post logged in,
socials link to my handle.
I return every few years,
get filled with nostalgia.
Now back to work,
to do whatever.
But not with my Perl,
not today, and likely not ever.
The wise coder will never pipe grep into awk
For unneeded processes cause neighbours to talk.
The wise coder will never type cat file | foo
Unless they want a UUoCA too.
The wise coder will never discard output from backticks
As that displays ignorance of better tactics.
The wise coder won't shell out to grep, awk or sed
Since no JAPH would be seen doing that, dead.
Looking for ways to get perl to make Magic?
Any odd way to print that word: like a JAPH!
This shell one liner runs 3 perl one liners that run
perl 4 times to make Magic:
perl -e'$_="Larry";while(++$_){print"\rPerl is $_";goto(MAGIC)if/Magic
+/}MAGIC:print"\n"';perl -v|perl -pe's\Perl\Magic\magic';perl -e'print
+"[Perl$^V] ";<STDIN>'