On Jan 20, Mat Harris said:

>my boss emailed me this little snippet this morning and I have to confess it
>has me stumped.
>
>Please can someone break down this translation for me?

I hope you (or your boss) have a sense of humor.

>perl -le '$_="7P0>374;";tr[0->][ LEOR!AUBGNSTY];print'

Do you know what the tr/// operator does?  It takes a list of characters
to find a list of characters to replace them with.  tr/abc/def/ changes
each 'a' to a 'd', each 'b' to an 'e', and each 'c' to and 'f'.  You can
use the syntax a-z to mean abcdefghijklmnopqrstuvxyz; specifically, it
works via ASCII ranges, so the range 0-> means 0123456789;:<=> which means
the tr/// is

  tr/0123456789;:<=>/ LEOR!AUBGNSTY/

where the /// delimiters have been replaced by [][] (which can help
increase readability).  Your input string to tr/// is $_ by default, and
$_ is "7P0>374;".  Do the translation yourself.

For bonus points (for me, I guess), your boss got the tr/// line from the
"all your base" craze of a few years ago.  The right-hand side contains
all the characters needed for "ALL YOUR BASE ARE BELONG TO US!".

-- 
Jeff "japhy" Pinyan      [EMAIL PROTECTED]      http://www.pobox.com/~japhy/
RPI Acacia brother #734   http://www.perlmonks.org/   http://www.cpan.org/
<stu> what does y/// stand for?  <tenderpuss> why, yansliterate of course.
[  I'm looking for programming work.  If you like my work, let me know.  ]


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to