ric00015 has asked for the wisdom of the Perl Monks concerning the following question:
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Module not loading completely?
by kcott (Archbishop) on Oct 30, 2013 at 05:23 UTC | |
by ric00015 (Beadle) on Oct 30, 2013 at 16:54 UTC | |
|
Re: Module not loading completely?
by zork42 (Monk) on Oct 29, 2013 at 18:55 UTC | |
by ric00015 (Beadle) on Oct 29, 2013 at 19:27 UTC | |
by rminner (Chaplain) on Oct 30, 2013 at 12:15 UTC | |
by ric00015 (Beadle) on Oct 30, 2013 at 15:35 UTC | |
|
Re: Module not loading completely?
by marinersk (Priest) on Oct 29, 2013 at 19:35 UTC | |
by jhourcle (Prior) on Oct 29, 2013 at 19:47 UTC | |
by ric00015 (Beadle) on Oct 29, 2013 at 19:50 UTC | |
by MidLifeXis (Monsignor) on Oct 29, 2013 at 19:52 UTC | |
by marinersk (Priest) on Oct 30, 2013 at 00:21 UTC |