go ahead... be a heretic | |
PerlMonks |
Re: fun with subroutinesby LAI (Hermit) |
on Apr 16, 2003 at 16:52 UTC ( [id://250968]=note: print w/replies, xml ) | Need Help?? |
Okay, I'll give this a shot. My first longish obfu deconstruction: Here's the obfu, deparsed:
The first thing that happens is a funny map. A string get split up and passed through map, passing each letter through sub _. This returns a coderef (more on that one later), so that we have at the end of the map an array of coderefs. Next the array gets "sorted". Funny thing, though -- the sort routine always returns 1. This is where the thing gets further into internals than I can get, but maybe someone can clarify this bit in my stead. It seems to rely on the internals of sort, and how it deals with ordering stuff. It is fooled into always thinking that $a > $b. Anyway, @w is then iterated over, dereferencing the coderef each time (told you I'd get to it). This sets the output record separator to whichever letter was originally mapped in, then sets $_ to an empty string. The empty string is printed, then the ORS, printing out the whole string. LAI __END__
In Section
Obfuscated Code
|
|