in reply to tr/// vs s/// for single character

Basically, you just need to read the pod to understand.

perlfunc:perlop tr eq y///

s/// deals with regular expressions, and tr deals with lists of characters (so if you're not looking to match and replace patterns, you're looking to transliterate characters).

 
___crazyinsomniac_______________________________________
Disclaimer: Don't blame. It came from inside the void

perl -e "$q=$_;map({chr unpack qq;H*;,$_}split(q;;,q*H*));print;$q/$q;"

  • Comment on (crazyinsomniac) Re: tr/// vs s/// for single character

Replies are listed 'Best First'.
Re: (crazyinsomniac) Re: tr/// vs s/// for single character
by Flame (Deacon) on Oct 07, 2001 at 23:43 UTC
    Well, that answers that, I suspected it had been asked before, I just didn't try the right search... heh.

    Thanks


    "Wierd things happen, get used to it"

    Flame ~ Lead Programmer: GMS
    http://gms.uoe.org