$a="0"x24;%b=(x20,[4,C,11],## x61,[5,13],x63,[14],x65,[A,E, 16],x68,[9,12],x6A,[0],x6B,## [15],x6C,[10],x6E,[6],x6F,[7] ,x70,[D],x72,[B,F,17],x73,[2] ,x74,[3,8],x75,[1]);foreach## $c(keys%b){foreach(@{$b{$c}}) {substr$a,hex,1,chr(hex($c)); }}print"$a";#fun with hashes#

I suppose I could have formatted it to make it look like something other than a square, but my right brain wasn't kicking in this evening.

Replies are listed 'Best First'.
Re: JAPH˛
by husoft (Monk) on Oct 24, 2002 at 12:33 UTC
    Nice JAPH, after I saw the code I started to play with it. I think it's better if you use the -l option. I was bored at wOrk :\
    #!perl -l $a="0"x24; %b=(x20,[4,C,11],x61,[5,13],x63,[14],x65,[A,E,16],x68,[9,12], x6A,[0], +x6B,[15],x6C,[10],x6E,[6],x6F,[7],x70,[D],x72,[B,F,17], x73,[2],x74,[ +3,8],x75,[1]); foreach $c(keys %b){ foreach(@{$b{$c}}){ substr $a,hex,1,chr(hex($c)); } } print"$a";
    ------------------
    #!perl -l $a="0"x24 ;%b=(x20, [4,C ,11],x61,[5,13], x63,[14],x65,[A, E,16],x68,[9,12], x6A,[0],x6B,[15], x6C ,[10] ,x6E,[6],x6F,[7], x70,[D],x72,[B,F, 17],x73,[2],x74,[ 3,8],x75,[1]);### for $c(keys %b){for(@{$b# #x70,[D],x72, {$c}}){substr $a,# hex,1,chr(hex($c)) ;}} print"$a";#fun with #hashes#x70,[D]x70,
    --------------------
    #!perl -l $ a=# "0"x24; %b=(x20,[ 4,C,11],x61 ,[5,13],x63,[ 14],x65,[A,E,16 ],x68,[9,12],x6A,# [0],x6B,[15],x6C,[10] ,x6E,[6],x6F,[7],x70,[D], x72,[B,F,17],x73,[2],x74,[3 ,8],x75,[1]);foreach$c(keys%b ){foreach(@{$b{$c}}){substr $a, hex,1,chr(hex($c));}}print"$a";##