On Tue, 2003-08-12 at 18:17, [EMAIL PROTECTED] wrote:
> That sounds like a sane idea. Can you test the patch below a bit,
> and let me know if there's anything still missing?
>
> Alternatively, a snapshot that contains the same patch is available at:
>
> http://aut.dyndns.org/tmp/Module-ScanDeps.tar.gz
> MD5 (Module-ScanDeps.tar.gz) = b78d916bff0d2dcee19d23fa350f4ec7
This version recognizes a lot more Tk modules than the previous.
However there's a typo around line 368:
while (/->\s*Scrolled\s*\[^A-Z]*([A-Z]\w+)/g) {
^--- backslash wrong here
which could be rephrased as
while (/->\s*Scrolled\W+([A-Z]\w+)/g) {
Also I noticed that "use base Foo" isn't handled (except that
you add "base.pm" to the module list). Possible solution:
sub scan_chunk {
my $chunk = shift;
# Module name extraction heuristics {{{
my $module = eval {
$_ = $chunk;
return [ 'base', grep { !/^q[qw]?$/ } split(/[^\w:]+/, $1) ]
if /^\s* use \s+ base \s+ (.*)/x;
...
BTW, is there a reason that scan_deps uses breadth-first search?
I'm trying to understand why scanning a 1000 line script
(albeit one using Tk and some other modules) takes 45 seconds
on an otherwise speedy Sun E4500.
Cheers, Roderich