sourcecode
bikeNomad
<code>
# Run another Perl program and print list of loaded files to STDERR
#!/usr/bin/perl -w
my $db = <<'EOF';
sub DB::postponed {
my $glob = shift;
$glob =~ s/.*::_<//;
print STDERR "$glob\n";
}
sub DB::DB { }
EOF
($ENV{PERL5DB} = $db) =~ tr/\n/ /;
system($^X, '-d', @ARGV);
</code>
This little script will monitor the behavior of require/use in your script. It will run another Perl program and print out whatever files it's loading to STDERR.<p>Just run it on another program like this:<code>
perl watchRequire.pl myProgram.pl arg1 arg2 2>required</code>
Miscellaneous
Ned Konz, [bikeNomad], ned@bike-nomad.com