I liked this one, and I offer my attempt at a spoiler below, and it's not 100% imho. (My attempt). I liked your use of split-pop and using $_ as a subroutine ref.. I wasn't quite sure why/what
$^&& but I think I narrowed it down to another way to write a while loop..
Sorry I can't offer much insight, but it was fun. :)
highlight <<HIGHLIGHT;
#!/usr/bin/perl -w
use strict;
##$^=length of @_ which = split on anything the variable
##$_ (which = "\nrekcaH lreP rehtonA tsuJ)
$^=@_=split//,$_="\nrekcaH lreP rehtonA tsuJ";
##At this point, $^=25, @_="\nrekcaH lreP rehtonA tsuJ";
##$_=an anonymous subroutine that is passed $_ (remember,
##$_=the backwards japh)
$_= &{sub{ ## We create another subroutine inside this one (I think)
%_=map{++$/=>$_}split'',pop;
## For every char returned by (pop) we split,
## Applying that split's $_ to the hash returned
## By increasing the value in $/ by one,
## $/ starts out as newline, ++ makes it a 1..
\%_
## I haven't figured out why we make a ref to %_ yet
}}($_);
_:## I suspect the goto below has something to do with this.. ;)
$/='!@_';## Also sets $/ to '!@_';
$/=~s^.{3}^%s^;## Replaces all (three chars in string anyway) with %s
## while($^) goto _ but in the sprintf we printf the value at ${_} (created with map above)
$^&&goto$'.sprintf(''.'_',printf$/,${$_}{$^--});
HIGHLIGHT
One4k4 -
perlmonks@poorheart.com (
www.poorheart.com)
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.