Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery

Re: Stripping characters...

by fruiture (Curate)
on Mar 04, 2003 at 08:44 UTC ( #240273=note: print w/replies, xml ) Need Help??

in reply to Stripping characters...

To create a complementary character class, use [^...], see perlre. In order to strip characters, tr/// is the better (=more efficient) choice:

$string =~ tr/a-zA-Z//cd;

See perlop for what tr///cd does.


Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://240273]
[choroba]: Corion A colleague has helped me. It seems the "Modification of read-only value" was caused by old Test::More version which doesn't have done_testing, plus the old bug with $@ sometimes showing a different exception
[choroba]: will upload a fixed version and see
[Corion]: choroba: Ah, OK - sounds like a really weird combination :)

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (7)
As of 2018-06-25 14:14 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (126 votes). Check out past polls.