Beefy Boxes and Bandwidth Generously Provided by pair Networks Cowboy Neal with Hat
The stupid question is the question not asked
 
PerlMonks  

Re: Can someone explain this one to me?

by btrott (Parson)
on Jun 16, 2001 at 06:19 UTC ( #88993=note: print w/ replies, xml ) Need Help??


in reply to Can someone explain this one to me?

This uses transliteration to map a certain set of characters to another set. The source set is comprised of the ASCII characters from '0' to '>'. If you look at the source string, you'll notice that it's comprised entirely of characters within the source set.

The tr takes the source set and maps it onto the destination set, which is ' LEOR!AUBGNSTY'; for each character in the source set, it gets mapped to the corresponding character in the dest set. For example:

'0' => ' ' '1' => 'L' '2' => 'E' ... '>' => 'Y'
It's just like a substitution cipher (I think that's the right name). You can do it manually: go through the source string, the string in $_, which is
6110>374086;2064208213:90<307;55
and replace each character by the corresponding character in the destination set. '6' is turned into 'A', '1' is turned into 'L', '1' is turned into 'L', etc. And right there you have 'ALL'.

Make sense? The key point here is to know what tr does, so you should read the docs for that if you're still not sure how this works.


Comment on Re: Can someone explain this one to me?
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (6)
As of 2014-04-20 09:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (485 votes), past polls