Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re^3: will be happy to read the explanation

by Danikar (Novice)
on Nov 20, 2007 at 16:40 UTC ( [id://651960]=note: print w/replies, xml ) Need Help??


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

I am quite confused on how y; -/:-@[-`{-};`-{/" -;; works as well.
  • Comment on Re^3: will be happy to read the explanation

Replies are listed 'Best First'.
Re^4: will be happy to read the explanation
by Anonymous Monk on Nov 21, 2007 at 07:36 UTC
    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.
Re^4: will be happy to read the explanation
by Danikar (Novice) on Nov 22, 2007 at 08:48 UTC

    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.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (2)
As of 2024-04-26 03:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found