Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

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).


www.jasonkohles.com
We're not surrounded, we're in a target-rich environment!

In reply to namespace::clean and "Unknown Error" by jasonk

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



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (4)
As of 2024-04-19 05:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found