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)