Very cool! It intrigued me enough to try to figure out how it worked - I hope I got close (this is my first attempt at a de-obfuscation):

Spoiler in readmore!

Walking through the code after a bit of reformatting, with some comments:

# Use a hash slice to copy all the keys in the symbol table to %s, # and set each key to undef. @s{keys %::}=(); # Bless a hashref into the current package, thereby creating # AUTOLOAD and DESTROY entries in symbol table. bless{};; # Pull out any keys in %s that are not in %:: (AUTOLOAD and DESTROY), # sort them, and take the second element (DESTROY). # Assign an anonymous sub to the DESTROY typeglob. *{ (sort grep{ !exists $s{$_} } keys %:: )[1] } = sub { $n = 0.5; { # Print a carriage return (sends cursor to beginning of line). # Split the JAPH text into single characters, then for each # character, choose a random number between 0 and 100, # compare to $p and print the character or a space. # Note: as $p increases there is a better chance of # displaying the character (and visa versa). # Question: is the comma in the JAPH text intentional? print "\r", map { rand(100) <= $p ? $_ : ' ' } split //, "Just another Perl hacker,"; # Stop loop when $p < 0 ($n is 0.5 or -0.5, so always < 1). $p < 0 && $n < 1 && last; # Use $n to increase or decrease $p by 0.5 # $p increases from 0.5 to 110.5, then decreases to -0.5 $n *= $p > 110 ? -1 : 1; # change sign of $n if $p > 110 $p += $n; # increase/decrease $p by $n # Use the four-arg form of select (ready file descriptors): # $q is undef, and the timeout value is set to 0.04 sec # This is equivalent to sleep 0.04 with better resolution. select $q, $q, $q, .04; # Redo this block redo } }; # This can be rewritten as 'bless \$0; $| = 1;' # Bless the scalar $0, but since we didn't save a reference to the # newly created object it is immediately destroyed - the DESTROY # method is called on the object, and the sub above is executed. # This can be observed by explicitly declaring an alternative # DESTORY method, or by adding 'print "destorying $_[0]\n";' # to the first line of the subroutine. bless \$|++;
Update: the original code was tweeked, but I don't think it changes this explanation.

In reply to Re: Clean up and shimmer by bobf
in thread Clean up and shimmer by davido

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.