Great job. cristian++
With the indulgence of the monks I will try my hand at a spoiler.
Now I'll replace 'and' with ';', evaluate character bitwise &, and replace builtin $%.sub _ : { print $_[$%] and ( z &'q' ); } $= = *= = _( z &'n' ) and $= .= *::_ = ( _ . ( z &'l' ) ) and $= =~ s~\*.*:~\x61~ and print $=
It is starting to look normal isn't it? Now we'll take line by line.sub _ : { print $_[0] ; ( 'p' ); } $= = *= = _( 'j' ); $= .= *::_ = ( _ . ( 'h' ) ); $= =~ s~\*.*:~\x61~; print $=
The colon is not a valid name so Perl ignores it. So we have a simple subroutine. ( 'p' ) is the same as return 'p' leaving us with:sub _ : {
Next:sub _{ print $_[0];return 'p'}
The first assignment is bogus which leaves us with an assignment to a typeglob. The subroutine _() prints the 'j' and returns the 'p' to be assigned to the typeglob.$= = *= = _( 'j' );
I rearranged the parentheses. This is the tricky part and does the bulk of the work. Starting from the right. We have an 'h' which is concantenated with the returned 'p' from the subroutine, but the eval is assigned to the typeglob of the subroutine. The typeglob appended to 'ph' is assigned to $= to give '*main::ph'. Since _() was called with no arguments nothing is printed, which also means warnings fails.$= .= (*::_ = ( _ . 'h' ) );
An interesting side effect which sidetracked me for some time was what happens when _() exits. Here I'm a little very unsure of the exact sequence but when the eval goes out of scope a DESTROY is called on the typeglob, that includes the Handle =. This results the interesting call: "IO::Handle::DESTROY(/usr/local/lib/perl5/5.8.5/mach/IO/Handle.pm:326):
326: sub DESTROY {}" which is harmless.
A straight forward substitution to replace the '*main::' with the character 'a'. $= now contains 'aph' which is next printed to finish the 'japh'.$= =~ s/\*.*:/a/
Thank you for you indulgence oh patient monks.
In reply to Re: Simply JAPH
by starbolin
in thread Simply JAPH
by cristian
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |