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.
In reply to Re: Is this the time for a negative lookbehind?
by dws
in thread Is this the time for a negative lookbehind?
by patgas
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |