in reply to Confused by use base, I think.

Morning folks: Thanks for the additional sets of eyes on this.

Ikegami: Your warn(ref($self)) gives me:

test-cgi-tabpane.cgi: My::New::Module::Admin
and uncommenting the debug code you mention yields:
main /usr/lib/cgi-bin/test-cgi-tabpane.cgi 51
Chromatic: I renamed my My::New::Module::Admin::new() method, as My::New::Module::Admin::_new, hoping that would force it to inherit My::New::Module::new instead. So I assume you want to see that, which reads:

sub new { my $class = shift; my $defaults = shift; my $self = {}; if(defined($defaults->{'object'}) && (UNIVERSAL::isa($defaults->{'object'},'My::New::Module') || UNIVERSAL::isa($defaults->{'object'},'My::New::Module::WWW'))){ $self = $defaults->{'object'}; } elsif(defined($defaults->{'cfg'}) && UNIVERSAL::isa($defaults->{'cfg'},'Config::Simple')){ $self->{'cfg'} = $defaults->{'cfg'}; } elsif(defined($defaults->{'config_file'})){ my $config_file = $defaults->{'config_file'}; # print STDERR $config_file,"\n"; $self->{'cfg'} = Config::Simple::Inherit->inherit({ filename => $c +onfig_file }); } elsif(defined($defaults->{'config_files'})){ my $cfg; undef($cfg); foreach my $file (@{$defaults->{'config_files'}}){ # print STDERR "My::New::Module::WWW->new() # says \$file is $file \n"; $cfg = Config::Simple::Inherit->inherit({ base_config => $cfg, filename => $file }); } $self->{'cfg'} = $cfg; # print STDERR Dumper(\$cfg); } else { die "Constructor invoked with no Confirguration File." } $self->{'q'} = CGI->new(); $self->{'agent'} = WWW::Mechanize->new(); my $db1 = $self->{'cfg'}->get_block('db1_params'); my $db2 = $self->{'cfg'}->get_block('db2_params'); # print STDERR Dumper(\$db2),"\n",Dumper(\$db2); $self->{'dbh1'} = My::New::Module::DB->connect2($db1_params); $self->{'dbh2'} = My::New::Module::DB->connect2($db2_params); $self->{'s'} = CGI::Session->new( undef, $self->{'q'}, { Directory => '/tmp/sessions'} ) or die CGI::Session->errstr; $self->{'s'}->expire('+1h'); $self->{'s'}->flush(); my $auth_params = $self->{'cfg'}->get_block('auth'); $self->{'auth'} = CGI::Session::Auth::DBI->new({ CGI => $self->{'q'}, Session => $self->{'s'}, DBHandle => $self->{'dbh1'}, EncryptPW => $auth_params->{'EncryptPW'}, GroupField => $auth_params->{'GroupField'} }); bless $self, $class; return $self; }
I'm not sure what additional clues that provides us, but am grateful others are looking at this with me. Thanks again.

-- Hugh

if( $lal && $lol ) { $life++; }

Replies are listed 'Best First'.
Re^2: Confused by use base, I think.
by chromatic (Archbishop) on Jun 15, 2008 at 13:21 UTC

    You're reblessing your object into the wrong class. No wonder Perl can't find your method.

    $self = $defaults->{'object'}; ... bless $self, $class;

    I'm not sure what you intend to do with those lines, but they don't have the desired effect.

    Similarly:

    UNIVERSAL::isa($defaults->{'object'},'My::New::Module')

    ... is correct only in very simple circumstances. It's more correct to write:

    $defaults->{object}->isa( 'My::New::Module' )

    ... but then again, it's not clear what you intend this code to do.