Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Comment on

( #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":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • 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, 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, 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.
  • Log In?
    Username:
    Password:

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

    How do I use this? | Other CB clients
    Other Users?
    Others chilling in the Monastery: (6)
    As of 2015-07-02 23:36 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









      Results (47 votes), past polls