I'm recycling this from an entry I had in one of the Obfuscation contests.

v("\150",sub{vec($q,0,32)=0x4a505420; @w=split//,$q;return@w;});sub k{$t="\x20cmp\x20";if($#_>0){($^W,$i )=0;for$f(sort{$p="$_[0]{$a}{$_[1]}$t $_[0]{$b}{$_[1]}\x20";for($#=1;$#<=( $#_-2);$#++){$p.="or\x20$_[0]{$a}{$_[ $#]}$t$_[0]{$b}{$_[$#]}\x20";}$p.=";" ;eval$p;}keys%{$_[0]}){for$r(keys%{$_[ 0]{$f}}){$s{$i}{$r}=$_[0]{$f}{$r};}$i++ ;}return(\%s);}}sub p{print@_}for(keys %s){for$e(@a){p("$s{$_}{$e}\x20");}p($/ );}sub v{$^X=~s/^.*(\/|\\)//;${$_[0]}= {0,{"\x54","Journal","\120",$^X,"\x4a", "Read"},1,{"\124","Today"=>"\x50",$^X=> "\112","Hack"}};shift@_;k(\%${"\150"}, @a=&{shift@_});}

Cheers,
KM

Replies are listed 'Best First'.
RE: Order by
by athomason (Curate) on Jun 04, 2000 at 05:46 UTC
    Nice, but I had a problem. It worked with Perl 5.005 under SunOS and Redhat, but I got a compiler error with ActiveState 5.6 under Win32. It didn't like the postinc of $# on line 6: 'syntax error at - line 6, near "+)". I don't have 5.6 on any other platforms or earlier versions for win32, so I can't tell if this is a platform or version bug... anybody have some insight?
      Yup. 5.6 on Linux complains as well. ++$# works fine though.
      Interesting. I haven't tried it on 5.6, only 5.005 (FreeBSD, Linux, and *cough*NT*cough*). I am going to play with that, and maybe sent it to p5p. Or, has anyone seen this in the 5.6 docs? Maybe this is Yet Another Thing Not Working in 5.6

      Cheers,
      KM

        I sent in a bug report, but I haven't gotten a human reply yet. I'm not nearly familiar enough with the internals of Perl to look for the problem myself, unfortunately.