Perl Hacker

Home Page
Perl Hacker
Matthew B-M

As a job, I write a fair bit of Perl, in my view it is a really wonderful language, no matter what anyone else might say. (If you're interested have a look at www.perl.com.)

I have written a very few japh scripts as well, some of which are below:
(The rules were 2 lines, 74 chars per line)

Two rather silly ways of reversing a string other than the rather simpler print reverse split // , string

perl -e '$_="\n.rekcah lreP rehtona tsuJ";m!$!;print $& while($`=~m!.$!s)'
perl -e '$i=sub{length($_[0])-1};$_= "\n.rekcah lreP rehtona tsuJ" ;while(
&$i($_)){print unpack "x".&$i($_)."a1", $_ ;$_=unpack"a".&$i($_),$_}print'

Based on Christophe's CLISP "just another lisp hacker":
(format t "~@(~@{~31r~^ ~}~)." 595756 9556552524 643802 496307950)

perl -e 'for$i(117082,189261552,173196,41500708){$_.=i($i)." "}sub i{my($i
)=@_ ;$i>21 ?i($i /22).i( $i%22) :pack"c",96 +$i}s; $;.\n;;y;jp;JP;;print'
An idea of Tim's, strip off the top bit in the encoding
perl -e '$_=unpack"b196",pack"H50","cafa9c0e0abbdf7474590e8296e56c103a3c".
"5e97e52e104821";while(m(^.{7})){$a.=$&."0";$_=$'"'"'}print pack"b224",$a'
and a random polyalphabetic substitution
perl -e '$_="Oyvv bsswjfw Thtm mefmfw2\n";while(m([^\n])){$_=$'"'"';$a=$&;
$a=($a=~m(^\s)?$a:pack "c",unpack("c",$a)-5+($i++%5));print $a}print"\n";'

I submitted some entries to the even.pl problem in the golf tournament on the Fun with Perl mailing list, including my favourite one, which was:

#!perl -p

It was decided that this, and similar solutions could be "Tall trees".

You might also want to see Alex Knowles' sigfile collection.

Occasionally, I've been known to hold shaped-program competitions [1] and [2] for Cam.pm

Valid XHTML 1.0!

This page last modified on Tuesday, 05-Jul-2016 10:21:17 UTC
Contact <webmaster@colondot.net> for more information about this site, or <plunder@colondot.net> if you want not to be able to send any more mail to this machine.