Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: The ol' hook 'n switch routine

by SarahM (Monk)
on Jun 13, 2002 at 23:27 UTC ( [id://174373]=note: print w/replies, xml ) Need Help??


in reply to The ol' hook 'n switch routine

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!

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (6)
As of 2024-04-20 00:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found