in reply to script to check modules exist...
use Data::Dumper; my %g_modules; Traverse( $_ ) for ( @INC ); print Dumper \%g_modules; sub Traverse { my $dir = shift; opendir my $dh, $dir or die "$!: $dir\n"; for my $file ( grep !/^\./, readdir $dh ) { my $path = "$dir/$file"; if ( -d $path ) { Traverse ( $path ); } elsif ( $file =~ /\.pm$/ ) { $g_modules{ $file } = 1; } } closedir $dh; }
One world, one people
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: script to check modules exist...
by toolic (Bishop) on May 02, 2011 at 15:04 UTC | |
by anonymized user 468275 (Curate) on May 03, 2011 at 09:00 UTC | |
|
Re^2: script to check modules exist...
by Anonymous Monk on May 03, 2011 at 10:05 UTC |