If it helps, here's my test program. Still haven't found a solution to get all of them, but your comments are helping... Thanks!
Update: I added some more test cases...
#!/usr/bin/perl -w use strict; local $/ = undef; my $file = <DATA>; while ( $file =~ # m,(use|require)[\s\+]+([\w:]+)\s*[^;]*;,igs # m,(?:use|require)\s+([\w:]+)\s*[^;]*;,igs # m,^[^#]*(use|require)\s+([\w:]+)\s*[^;]*;,igm m,^(?:use|require)\s+([\w:.]+)\s*[^;]*;,gms ) { printf( "%-20s %-20s %-20s\n", $1 || '*', $2 || '*', $3 || '*' ); } __DATA__ use one; require two; use three; # use four; # this is why you should use five. use Six::Maybe; require Seven.As.Well; require Eight ; # haha! use # nine; just kidding Nine;
"We're experiencing some Godzilla-related turbulence..."
In reply to Re: Is this the time for a negative lookbehind?
by patgas
in thread Is this the time for a negative lookbehind?
by patgas
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |