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

Re^3: regex subst not DWIM

by suaveant (Parson)
on Dec 19, 2007 at 22:52 UTC ( [id://657995]=note: print w/replies, xml ) Need Help??


in reply to Re^2: regex subst not DWIM
in thread regex subst not DWIM

Ok... first problem I see (besides the params regexp already pointed out... is your not_method regexp piece...

you didn't put it in a container, so your pipes aren't doing what you expect...

if ($line =~ /^\W*(?:$not_method)/) {
That'll work better.

Update a \b at the end would also help make sure you don't match a string starting with as or if etc...

if ($line =~ /^\W*(?:$not_method)\b/) {

                - Ant
                - Some of my best work - (1 2 3)

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (5)
As of 2024-04-25 16:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found