Hi everyone, I have a script called switchscan.pl which is turned into an executable called switchscan through the use of Par Packer. When I run the switchscan, it tries to load the module SwitchScan::Service::local::mlnx, but I end up with this error:

Attempt to reload SwitchScan/Service/local/mlnx.pm aborted (#1) (F) You tried to load a file with use or require that failed to compile once already. Perl will not try to compile this file agai +n unless you delete its entry from %INC. See "require" in perlfunc +and "%INC" in perlvar. Compilation failed in require at script/switchscan.pl line 42 (#2) (F) Perl could not compile a file specified in a require statement +. Perl uses this generic message when none of the errors that it encountered were severe enough to halt compilation immediately. BEGIN failed--compilation aborted at script/switchscan.pl line 42 (#3) (F) An untrapped exception was raised while executing a BEGIN subroutine. Compilation stops immediately and the interpreter is exited. Uncaught exception from user code: Attempt to reload SwitchScan/Service/local/mlnx.pm aborted. Compilation failed in require at script/switchscan.pl line 42. BEGIN failed--compilation aborted at script/switchscan.pl line 42.

How do I get the actual error that caused the compilation failure? When I run perl -c on mlnx.pm before packing everything with Par Packer, I get "syntax OK". Something in the packing process is causing the failure, but I'm at a loss for how to further troubleshoot.

Much appreciated.


In reply to Compilation failed in require, but how to get the actual compilation error? by Anonymous Monk

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.