I think I broke my Perl installation over the weekend by upgrading all the CPAN modules. I saw that a whole bunch were out of date, asked the Perl admin if he wanted them all updated, he said Sure, and I ran upgrade on them. That was Friday before I left. Monday, I get to work, and my script is all broken.

The specific error is Undefined subroutine &Module::subroutine called at /home/path/module.pm line 128, <FILE> line 30.. My program is a gui, where the Tk code is in a separate module, and all the logic is in yet another module. This logic module (called CORE) uses other modules and calls them only in this module, not the main program. The subroutine in question is not exported, but that shouldn't matter since I am using the Module::subroutine naming.

In trying to get this program to work properly again (it was working just fine before I update those modules), I tried use lib, use File::FindLib in both the module and the main program to no avail. I also tried installing a new perl (5.18.1, old was 5.16.0), with new modules, to see if an updated module broke my flow, but no, it still has the same problem.

I eventually found a sort-of workaround, and that was to use require on the module that wasn't loading. And this showed me something very interesting: some of the subroutines were being redefined! 9 of them, in fact, were already loaded and defined; the program is now working properly.

In testing this new solution, I found that both versions of Perl are the same in this respect (I specified which perl to use in the shebang). In fact, the only difference so far is the given/when/Smartmatch is experimental warnings from 5.18.1 (but that's a different annoyance).

So all of this leads to my question(s): Is this a case of a module loading incompletely? If so, what could possibly cause that to happen? But if not, what is going on?

You know what versions of Perl I'm using. Let me know if you need to know what version of a specific CPAN module I have. If it matters, I'm running on Red Hat 5.


In reply to Module not loading completely? by ric00015

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.