jasonk has asked for the wisdom of the Perl Monks concerning the following question:
I've been having a lot of problems lately with "Unknown Error" getting reported rather than the actual error message. Since it started at roughly the time I upgraded to 5.10, I figured it was some strange 5.10/OS X issue, and since it was occurring in a project that has a gigantic code base, it took me a while to track it down. Turns out it's actually something related to namespace::clean that is causing the problem.
I've managed to narrow it down to this minimal test case, but I haven't had any luck in figuring out why this is occuring...
package Test1; use namespace::clean; sub foo { if } # Yes, this is an intentional syntax error 1;
I'm simply running this code from the command line like so:
% perl -Ilib -MTest1 -e1
If you remove the call to 'use namespace::clean', this is the output (which is what I would expect)
syntax error at lib/Test1.pm line 2, near "if }" Compilation failed in require. BEGIN failed--compilation aborted.
However, when using namespace::clean, the output becomes:
Unknown error Compilation failed in require. BEGIN failed--compilation aborted.
Obviously this makes it very difficult to find bugs when it isn't even reporting which file the error was in when loading up hundreds of modules for a very large application. I realize namespace::clean is doing some pretty heavy magic, but I'd hate to give it up considering how tremendously useful it is.
Update:
Reported it to RT (43362). I also forked it on github and added a testcase (http://github.com/jasonk/namespace-clean).
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: namespace::clean and "Unknown Error" (non-glob globals)
by tye (Sage) on Feb 17, 2009 at 16:33 UTC | |
Re: namespace::clean and "Unknown Error"
by dk (Chaplain) on Feb 17, 2009 at 14:33 UTC | |
Re: namespace::clean and "Unknown Error"
by Anonymous Monk on Feb 16, 2009 at 19:01 UTC | |
by jasonk (Parson) on Feb 16, 2009 at 22:06 UTC |