It looks like you are running a messed up Perl 5.6 installation. Try the following code:
use Carp; croak("Test croak");
My bet is that you will get the same error. And the problem is that E:/Perl/lib/Carp/Heavy.pm probably has a syntax error in it. (Did someone edit it?) When you load Carp you don't see this error because the bulk of the module is autoloaded upon use. (This started with Perl 5.6, which is why I knew what version of Perl you had.)

But even if you fix that, you should work on your error handling. Using eval will trap errors, but if you are using eval, you should include $@ in your error message instead of guessing at what is wrong. Alternately you can use the file naming version of require. But as your code stands if your module doesn't return a true value, you will get an error that is confusing and counterproductive because it is wrong. (require is failing on a false return, but you will think it can't be found.)


In reply to Re (tilly) 1: New Problem? by tilly
in thread require $package? by Flame

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!
  • 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, details, 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, summary, 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.