Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
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.


In reply to Re: Can someone explain this one to me? by btrott
in thread Can someone explain this one to me? by Cody Pendant

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



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (4)
As of 2024-04-19 04:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found