disclaimer: This japh should be contained within a file of it's own. Attempting to execute the script outside a file may prove to be a futile effort ;/.

This is my first time playing with Japh code. I'll appreciate any constructive input and suggestions on how to improve the JAPH. I'd also like to thank belg4mit for his help prior to my posting this JAPH.

Unfortunately, I haven't produced any spoilers yet. But hope to do so on popular demand. ;-)
#% xxxxxx xx-+ xx xxx xx xx xx xx xxx xxxxx+ xx xx + xxxx xxxxx ......+ #x xxxxvxxx xx xx xv xxxx x+ %+ ===== xx xx xx xx x+ =x xx xx + xx xx xx ...+ #x xx xx xx xx xx xx xx xx xxx+ xxxxxx xx +x xx xx+x- + xxxx xxxx ........+ #% xx xx xx xx xx xx xx x+ xx xx =+=== xx xx xxxx-xx xx =x +x xx + xx xx xx ...+ #% xx xx xx -+x+ xxx+ xx xx xx xx xx x+ xx xxx+xx xx xx + xxxx xx xx ....+ $/='$';open(I,$0);$_=<I>;($/)=/(.) /;chop;s/ //;/(v)/;$-=$-[0];s;\Q$/\E; ;g;($/,$^)=/^(.)(.)/; for(split/ /){s,[ $/],,g;/(.)$/;$l= $-[0];/(.)/||next;$_ =chr$-+$l;$".=($1=~/$^/) ?" \u$_":$_;}print$";


UPDATE: Here's another rendition of the same thing:
open(I,$0);<I>;$~=$/;$/='~';$_=<I>;($/)=/(.)$~/;s/[$~~]//g;/(v)/;$-=$- +[0];s;\Q$/\E;$~;g;($/,$^)=/^(.)(.)/; #% xxxxxx xx-+ xx xxx xx xx xx xx xxx xxxxx+ xx xx + xxxx xxxxx ......+ #x xxxxvxxx xx xx xv xxxx x+ %+ ===== xx xx xx xx x+ =x xx xx + xx xx xx ...+ #x xx xx xx xx xx xx xx xx xxx+ xxxxxx xx +x xx xx+x- + xxxx xxxx ........+ #% xx xx xx xx xx xx xx x+ xx xx =+=== xx xx xxxx-xx xx =x +x xx + xx xx xx ...+ #% xx xx xx -+x+ xxx+ xx xx xx xx xx x+ xx xxx+xx xx xx + xxxx xx xx ....+~ for(split/$~/){s,[ $/],,g;/(.)$/;$l=$-[0];/(.)/||next;$_=chr$-+$l;$".= +($1=~/$^/)?" \u$_":$_;}print$";
This one appears to be prettier, doesn't it? :)

RE jynx: Hmm, this is rather odd. I have tried running the first japh on WinME as well as Solaris8 and things worked fine. Probably, you lost a few characters while copying or... use a different perl version from the one I have?

Fortunately, the second one works ;-).

_____________________
$"=q;grep;;$,=q"grep";for(`find . -name ".saves*~"`){s;$/;;;/(.*-(\d+) +-.*)$/; $_=<a HREF="/index.pl?node=%22ps%20-e%20-o%20pid%20"> "," $2 </a>;`@$_ +`?{print"+ $1"}:{print"- $1"}&&`rm $1`; print$\;}

Replies are listed 'Best First'.
Re: 'monk = hacker' JAPH.
by jynx (Priest) on Jun 11, 2002 at 17:04 UTC

    A small problem,

    It might just be my computer, but when running your first version i get an off by one error that renders the resultant string useless ('Kvtu Bopuifs Qfsm Ibdlfs' ne 'Just Another Perl Hacker'). Do you get the same results? Oddly, the second version doesn't suffer from this...

    jynx

      I get Warning: Use of "" without parens is ambiguous at /tmp/a line 8. (The offending bit is the matching of v, insert a newline before this expression and the warning disappears) But no off by ones (I got many one I was playing with the earlier versions).

      --
      perl -pew "s/\b;([mnst])/'$1/g"