http://qs1969.pair.com?node_id=903672

hesco has asked for the wisdom of the Perl Monks concerning the following question:

This is the feedback I get at the command line, running my test, which includes in relevant part:

package AClient::Mail::Log::Parse::ListMaintainence; sub tabulate_template_fields_by_email { my $self = shift; my $email = shift; isa_ok($self->{'cfg'},'Config::Simple::Extended'); can_ok($self->{'cfg'},'param'); can_ok($self->{'cfg'},'params'); my $uid = AClient::CMS::Drupal::SimpleNews::get_uid_from_email($self +,$email); # at which point it is bombing out. } package AClient::CMS::Drupal::SimpleNews; sub get_uid_from_email { my $self = shift; my $email = shift; my $sql_get_uid = $self->{'cfg'}->param("sql.get_uid_from_email"); my $sth_get_uid = $self->{'dbh'}->prepare($sql_get_uid); $sth_get_uid->execute($email); my ($uid) = $sth_get_uid->fetchrow_array(); return $uid; }
first from Test::More's isa_ok, and then from afailure:

ok 1 - The object isa Config::Simple::Extended ok 2 - Config::Simple::Extended->can('param') not ok 3 - Config::Simple::Extended->can('params') Can't locate auto/Config/Simple/Extended/params.al in @INC (@INC conta +ins: /home/hesco/system_admin/perl/lib lib /usr/lib64/perl5/site_perl +/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/site_perl/5.8.8 /usr/ +lib/perl5/site_perl /usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-t +hread-multi /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_pe +rl /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/5. +8.8 .) at /home/hesco/system_admin/perl/lib/ClientsCompany/Mail/Log/P +arse/ListMaintainence.pm line 186
In fact, at:

/usr/lib/perl5/5.8.8
I find:

/usr/lib/perl5/site_perl/5.8.8/Config/Simple/Extended.pm
My questions are these:

if( $lal && $lol ) { $life++; }
if( $insurance->rationing() ) { $people->die(); }

Replies are listed 'Best First'.
Re: Looking for wrong file to find package methods (autoload)
by tye (Sage) on May 09, 2011 at 01:35 UTC

    You are inheriting from something that inherits from an 'autoload' module. You can fix this by avoiding either of the two inheritance steps. Or you can add your own AUTOLOAD method so that 'autoload' module's one doesn't get called.

    For example, this is found in my Win32API::Registry module:

    # Since we ISA DynaLoader which ISA AutoLoader, we ISA AutoLoader so w +e # need this next chunk to prevent Win32API::Registry->nonesuch() from # looking for "nonesuch.al" and producing confusing error messages: use vars qw($AUTOLOAD); sub AUTOLOAD { require Carp; Carp::croak( "Can't locate method $AUTOLOAD via package Win32API::Registry" ) +; }

    - tye