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.


In reply to Re^2: perl crashes parsing huge script - how to find a line that crashes it? by bart
in thread perl crashes parsing huge script - how to find a line that crashes it? by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.