in reply to Is this the time for a negative lookbehind?
The lookbehind you show is for the string "!-". Looks like you might be confusing HTML comments for Perl ones.
I don't think you need a lookbehind. m,^[^#]*(use|require)\s+([\w:]+)\s*[^;]*;,igm should do the trick. I added the 'm' modifier so that ^ would match inside of a string, and removed the 's' modifier so that '.' wouldn't match \n.
Note that won't correctly handle require 5.003; If that matters, the change is left as an exercise.
|
|---|