lestrrat has asked for the wisdom of the Perl Monks concerning the following question:
I'm trying to include an external file on the fly from within some perl code, and I would also like to catch any "require" errors as well.
However, doing
eval{ require $somefile; }; if( $@ ) { print $@; }
only shows the top level error ( such as "Compilation failed in require at /foo/bar.pl" ). I want more detailed message, like "Global symbol $foo requires explicit package name at /blah.pl" type of messages as well.
How can I capture these messages from within Perl?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Capturing detailed error messages on 'require failure
by chromatic (Archbishop) on May 22, 2001 at 08:08 UTC | |
|
(tye)Re: Capturing detailed error messages on 'require failure
by tye (Sage) on May 22, 2001 at 05:07 UTC |