Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: (jeffa) Re: Pattern Matching

by Popcorn Dave (Abbot)
on Dec 16, 2002 at 17:07 UTC ( [id://220270]=note: print w/replies, xml ) Need Help??


in reply to (jeffa) Re: Pattern Matching
in thread Pattern Matching

In the line

$report =~ tr/-_.//d; # underscores, dashes, and periods

won't the . match any character and filter it out? Don't you need to escape it, or does it work differently with the tr as opposed to s?

There is no emoticon for what I'm feeling now.

Replies are listed 'Best First'.
Re: Re: (jeffa) Re: Pattern Matching
by fruiture (Curate) on Dec 16, 2002 at 17:11 UTC

    No, tr/// is not s/// or m//, but it's y/// :-)

    The transliteration operator does not have anything to do with regular expressions, that's why the . doesn't have special meaning in it. See perlop.

    --
    http://fruiture.de
      Thanks for the clarification!

      There is no emoticon for what I'm feeling now.

(jeffa) 3Re: Pattern Matching
by jeffa (Bishop) on Dec 16, 2002 at 17:11 UTC

Log In?
Username:
Password:

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

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

    No recent polls found