All right, nobody else has, so I'll take the bait. ;-)
For those who may not have seen them before (*cough* young whipper-snappers), uuencode and uudecode are encoding and decoding mechanisms that were originally developed to allow transmitting binary files via uucp over lines that were not always eight-bit-clean. Just like MIME.
Now, on to the real decode. I've separated the lines to make them a little easier to read.
#
# Set $$ -- usually the PID of the running Perl, but not a read-only
# variable -- to a strange string: first part looks like code,
# but latter half looks like junk. If you uudecode the junk (minus
# the embedded newline) you get:
#
# $_=q!$_='print "Just another Perl hacker"'!;
#
$$ = q{$_=unpack'u',q|L)%\]<2$D7STG<')I;G0@(DIU<W0@86YO=&AE<B!
097)L(&AA8VME<B(G(3L`|;};
#
# Set $} -- another strange variable -- to another strange string.
# This time the uuencoded part (again minus \n) is
#
# $_='$_=q!($_)=($$=~/.*/g)!';
#
$} = q{$_=unpack'u',q|<)%\])R1?/7$A*"
1?*3TH)"0]?B\N*B]G*2$G.P``|;};
#
# The next few lines remove embedded newlines in $$ and $} (first
# and fourth lines), and set these variables to these values:
# $; $_=$}; (second line)
# $_ $_\n=$;; (third line, including embedded newline)
#
$$=~s;\n;;g;
$;=q;$_=$};;
$_='$_
=$;;';
$}=~s;\n;;g;
#
# Each of these evals executes the code in $_. Before the first,
# $_ contains "$_\n=$;;" as shown above. Here are the values of $_
# after each eval completes.
#
eval;
# $_=$};
eval;
# $_=unpack'u',q|<)%\\])R1?/7$A*"1?*3TH)"0]?B\\N*B]G*2$G.P``|;
eval;
# $_='$_=q!($_)=($$=~/.*/g)!';
eval;
# ($_)=($$=~/.*/g)
# BTW, the parens and "=~ /.*/g" do nothing.
# Executing this is the same as "$_ = $$".
eval;
# $_=unpack'u',q|L)%\\]<2$D7STG<\')I;G0@(DIU<W0@86YO=&AE<B!097)L(&
+AA8VME<B(G(3L`|;
eval;
# $_=q!$_='print "Just another Perl hacker"'!;
eval;
# $_='print "Just another Perl hacker"'
eval;
# print "Just another Perl hacker"
eval;
# The final eval just executes the contents of $_ seen above.
eval;
BTW, if you try to execute this in the debugger, beware: setting $$ causes it to fork. Fiendishly clever!
|