Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister

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


Reported it to RT (43362). I also forked it on github and added a testcase (
We're not surrounded, we're in a target-rich environment!

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

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, 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?

    What's my password?
    Create A New User
    and all is quiet...

    How do I use this? | Other CB clients
    Other Users?
    Others rifling through the Monastery: (10)
    As of 2018-03-17 18:31 GMT
    Find Nodes?
      Voting Booth?
      When I think of a mole I think of:

      Results (225 votes). Check out past polls.