> > Is it possible to populate "my %Preload" hash with Tcl::Tk as 
> > a special case??
> 
> That won't help, because listing Foo.pm in %Preload doesn't prevent
> Foo.pm from being scanned, it only adds to the list of stuff to scan.

you're right, this is independent of string scanning...



> Anyway, can you try the following patch. It zaps all literal strings
> (at least the ones delimited by single or double quotes) just before
> the final round of regexes in scan_chunk (that should have no need
> to look into strings). 

thank you, that works...

Is it possible for this patch to be applied in official version?

Or make string scanning optional, with a command-line option?

> 
> $ diff -ub lib/Module/ScanDeps.pm{.orig,}
> --- lib/Module/ScanDeps.pm.orig 2006-07-24 10:19:02.531250000 +0200
> +++ lib/Module/ScanDeps.pm      2006-07-24 10:20:50.812500000 +0200
> @@ -622,6 +622,8 @@
>          }
>          return $1 if /(?:^|\s)(?:do|require)\s+[^"]*"(.*?)"/;
>          return $1 if /(?:^|\s)(?:do|require)\s+[^']*'(.*?)'/;
> +        s/"(?:\\.|[^"])*"//g;
> +        s/'(?:\\.|[^'])*'//g;
>          return $1 if /[^\$]\b([\w:]+)->\w/ and $1 ne 'Tk';
>          return $1 if /\b(\w[\w:]*)::\w+\(/;
> 
> This fixes the output of 
>    scandeps.pl -e "use Tcl::Tk;"
> for me (on Windows, using ActiveState perl).
> 
> Cheers, Roderich
> 

Reply via email to