hesco has asked for the wisdom of the Perl Monks concerning the following question:
Hola, all:
Last week I added fastcgi to my development server and now code which was essentially working is churning out errors like:
This code under development is organized as follows:Can't locate object method "_any_method_I_call" via package
My::Module begins:My::Module My::Module::Foo My::Module::Bar My::Module::Baz
and each of those modules begins:package My::Module; use warnings; use strict; . . . use My::Module::Foo qw( :all ); use My::Module::Bar qw( :all ); use My::Module::Baz qw( :all );
I have been able to restore some functionality by fully qualifying my method calls like so:package My::Module::Foo; use strict; use warnings; use Exporter; our @EXPORT = qw( this_method that_method ); our %EXPORT_TAGS = ( all => [qw( this_method that_method )] );
But there are 106 mostly working methods in this application so far and it is still growing. I would love not to have to rewrite every method call in the package in this way. Can anyone please advise me what is the matter here and what I could do about this?My::Module::Foo::this_method($self,@args);
Any clues appreciated.
-- Hugh
UPDATE:
Thanks to a remark in ikegami's post below, I went back into each of my use'd modules and changed them like so:
The result is that my code seems to work again. Thank you everyone who contributed to this discussion. Even those posts which did not immediately resolve this taught me quite a bit about the innards of perl. I had heard often of the symbol table, but had never known how to access it before. I suspect that should prove invaluable in the future. Thank you ikigami, perrin, esper, and how ever many anonymous monks may have contributed to this discussion.- use Exporter; + use Exporter qw( import );
I'm still curious why the pre-patch version worked before the dist-upgrade, but not after. But I'm grateful to be moving forward again. I'm hopeful I may yet have this code ready for a public launch at next weekend's conference. We shall see.
if( $lal && $lol ) { $life++; }
Back to
Seekers of Perl Wisdom