Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Re: Re: Range of chars except one

by Anonymous Monk
on Jan 21, 2002 at 08:47 UTC ( #140311=note: print w/replies, xml ) Need Help??


in reply to Re: Re: Range of chars except one
in thread Range of chars except one

True i thought about tr/// too... but "a range of chars except one", could also be read "a range of chars PLUS one" (i like to reverse things up). tr/// also offer a complement modifier to it.
So when i need to delete chars, it seems more simple to write the one i actually want to keep, preventing me to forget some:
$_ = "123,Let's keep letters!\nAnd new lines..."
tr/A-Za-z \n//cd;
print;
will print:
Lets keep letters
And new lines

Creating that range could be easier...

It's just my two cents.
Freddo

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (6)
As of 2023-03-28 08:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Which type of climate do you prefer to live in?






    Results (66 votes). Check out past polls.

    Notices?