and after each use statement put
If the use call makes it crash, isn't this too late? In that case, the print statement should come before the use call.
If it's not the use calls that makes it crash, then you can postpone the check of %INC until all modules are loaded, for example in a CHECK block, or else, at the top level at the very front of the script. Otherwise, you'll get a lot of nearly identical Dumper data for %INC, which is a lot of noise.
In this case, I'd do this:
#for every module (using Foo::Bar as an example):
BEGIN {
printf "use Foo::Bar at line %d \n", __LINE__;
}
use Foo::Bar; # replace with actual module name
BEGIN {
printf "Foo::Bar loaded OK\n";
}
# once for the whole script:
CHECK {
use Data::Dumper;
print Dumper \%INC;
}
If a use call makes it crash, you won't see the associated "module Foo::Bar loaded OK" message. If none did, you'll see the summary for %INC.
I have no idea how you can print the path of a module if just use of it makes perl crash...
p.s. As the OP says, no other than standard modules are used, then just a check of @INC might reveal if there's any suspicious root path in there.
And, oh: don't just install ActivePerl 5.10 on top of the installation of ActivePerl 5.8. Either use a parallel intallation, in a different root directory, or completely uninstall perl first and install everything again. That way you can avoid using any old modules, compiled for AP 5.8.
|