Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: A Thought on Perl Poetry and the Immortal JAPH

by cforde (Monk)
on Jul 07, 2001 at 02:17 UTC ( [id://94636]=note: print w/replies, xml ) Need Help??


in reply to A Thought on Perl Poetry and the Immortal JAPH

# 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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://94636]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (7)
As of 2024-04-23 16:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found