You know, this looks much worse then it actually is. You have to read it backwards since everything is chained together though.

First, you split your string on : or ?, which creates a list of numbers. That list is feed to map. Map then takes each number and runs it through a series of decrement and trinity operators. This continues until the number is 0, then a letter is returned. If you want to figure out which letter corresponds to which number, then you start at the end (with the ',') and count towards the beginning until you reach the number. Since map returns a list, a join is used to combine all the letters into the string 'print"Just another Perl hacker," '. Finally the string is evaluated, and the output printed.

How did I do? This is my first try at this, so let me know if I missed anything!


In reply to Re: The ol' hook 'n switch routine by SarahM
in thread The ol' hook 'n switch routine by meta4

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.