Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re^2: will be happy to read the explanation

by dynamo (Chaplain)
on Nov 20, 2007 at 01:26 UTC ( [id://651832] : note . print w/replies, xml ) Need Help??


in reply to Re: will be happy to read the explanation
in thread will be happy to read the explanation

Thanks, excellent reference--
but how does it get from a state where:
$_ = '=]=>%-{<-|}<&|`{'
to
$_ = 'system"rm -rf/"'
using only the following statement:
y; -/:-@[-`{-};`-{/" -;;
Doesn't tr/// require the destination characters to be included in the mapping? I don't see any alphanumerics in there at all.

Replies are listed 'Best First'.
Re^3: will be happy to read the explanation
by Danikar (Novice) on Nov 20, 2007 at 16:40 UTC
    I am quite confused on how y; -/:-@[-`{-};`-{/" -;; works as well.
      Ah I figured it out. Read up on tr/// and ull get it Think about this $_ = "abc"; y/a-c/x-z/; print $_; # Prints xyz It goes off an ascii table. ` is right before a and { is right after z.

      Ah it all makes sense now.

      y; -/:-@[-`{-};`-{/" -;;

      That translates characters.

      So (space) thru /
      : thru @
      [ thru `
      { thru }

      Take that set of characters and switch it out with the corresponding character in this list
      ` thru { (Includs a-z)
      /
      "
      -

      Pretty nifty.