# ignoring the leading comments
# a bareword and a couple of requires
I, require strict and do(not require warnings);
# define $answer as a reference to $u
my $answer = \$u unless $answer == '42';
# a label, just for fun
Question:
# the routine "you_do_the_hacker_foo" is not defined so...
if (defined by this_paradigm do you_do_the_hacker_foo(??)) {
# ...this subroutine is called
sub AUTOLOAD {
# $_ and $now contain the lines after "__DATA__", each line separated
+by "the"
$_ = $now = join 'the', <DATA>;
# translate the Fs to 0s and Os to 1s
y ?FO?01?;
# remove all occurances of o, the, spaces and newlines
# $_ contains only 0s and 1s, hmmm, a bit string
s.o|the| |\n..goe;
# take 7 characters at a time, hmmm, a byte with high order 0
# use eval to translate it to decimal ($u) and replace the 7 "bits"
# with the corresponding ASCII character
# $$answer is misleading, it's really just another name for $u
# this becomes the result of the eval which is passed to chr
s/(.{7})/(chr(eval'
# for each set of 7 characters assign $u=0 and $ate = 1
($u,$ate) = (0,1);
# reverse the order of the 7 characters and take them 1 at a time
# compute the decimal equivilent (base 2 to base 10)
foreach $foo(reverse split "",$1) {
$u += $ate*$foo;
$but_I = $ate *= 2;
}
# set the return value from the eval, this is really $u
$$answer'
))/eg;
# break $_ into pairs of characters and sort them
# print the second character in each pair
# pretty clever
$_ = join '', sort/(..)/g and print join '', /.(.)/go;
# $now is true, call exit to avoid reporting errors in the above if st
+atement
$now and exit, do(not die)
}
# some tin foil for the radar...
} else {
goto Question and $answer;
y???
}
Have fun,
Carl Forde