Fiddling with AUTOLOAD I came up with this. Mostly for my amusement, I'll turn it loose hoping someone else might get a kick out of it... By the way, it breaks a lot of sensible rules in the process.

eval'&'.join',&',split//,'JuSt_another_Perl_hacker.';sub AUTOLOAD{$ i++,($j,$k)=(sort keys%::)[$i,$i+1]until$j=~/ARGV/;${$k}=~s/^.*::// ;${$k}=~y/_S/ s/;print${$k}}

Update: ysth had a good idea. Here I've implemented it, and added another 'refinement'.

eval"&@{[join',&',split//,'Just_another_Perl_hacker.']}";sub AUTOLOAD {$i++,($j,$k)=(sort keys%::)[$i,$i+1]until$j=~/ARGV/;${$k}=~s/^.*::// ;${$k}=~y/_/ /;print${$k};sub s}

Update 2: Just had to try to golf it down a little:

eval"&@{[join',&',split//,'Just_another_Perl_hacker.']}";sub AUTOLOAD {($_,$k)=(sort keys%::)[$i++,$i]until/ARGV/;s/.*:://,y/_/ /,print for $$k;sub s}

End update.


While I'm at it, I found this next snippet on my scratchpad a few minutes ago. ...I remember when I doodled it out I wasn't satisfied enough to post it on its own. Consider this post a double-feature, and the second one here is just the B movie. ;)

$_='+$+[+]++@+{+}++%+[+++]+++*++\++\+++++++++++++++++++++++@+++++++++' .'+++++++++++++++++++(++++++++++++++)++++++++++++++++++++++++++++++++' ;;$/='+';while($_){$c++while chomp;;push@c,$c;;chop}print pack'c*',@c[ unpack'a2'x25,'02151314000309101406051200110512080006030407051201987']

Let me know what you think.


Dave


In reply to On-demand JAPH 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.