I know i've had problems using 'use base' with perl versions prior to 5.6, even though 
i believe it was supposed to have been
implemented earlier than that.  glad to see you got it worked out.

(I posted a similar issue to Perlmonks a few weeks ago)

-Stephen

-----Original Message-----
From: Mark Stosberg [mailto:[EMAIL PROTECTED]]
Sent: Thursday, September 27, 2001 04:12 PM
To: [EMAIL PROTECTED]
Subject: [cgiapp] Re: need help with "can't locate method 'new'" error
(SOLVED)



Hello,

I was able to solve the below error by updating QHB::Public.pm to say:

use QHB;
@ISA = ("QHB");

instead of:

use base qw(QHB);

I'm using Perl 5.005_03. Does this look like a Perl bug that was fixed
in a future version,
or am I still missing something? :) In "perldoc perltoot" distributed
with my perl, it mentions the former style as the way to do inheritance,
but clearly "use base" works fine in some other cases.

    -mark


Mark Stosberg wrote:
>
> Hello!
>
> I'm setting up the trick where I create my own super class, that other
> modules interit from, but I'm running into an error which I bet will be
> "obvious" to one of you. Here's what I think is essentional the bug:
>
> #### QHB.pm
> package QHB;
> use base 'CGI::Application';
>
> #### QHB::Public.pm
> package QHB::Public;
> use base qw(QHB);
>
> #### qhb.cgi
> package QHB::Public;
> use QHB::Public;
> my $app = QHB::Public->new();
> $app->run;
>
> # what happens:
> > ./qhb.cgi
> Can't locate object method "new" via package "QHB::Public" at ./qhb.cgi
> line 18.
>
> ####
>
> What am I missing? I'm expecting new() and other methods to trickle down
> from CGI::App
> to QHB to QHB::Public to qhb.cgi.
>
> Thanks,
>
>   -mark

--
 . . . . . . . . . . . . . . . . . . . . . . . . . .
   Mark Stosberg              Principal Developer
   [EMAIL PROTECTED]       Summersault, LLC
   v: 765-939-9301 ext 223    website development
 . . . . . http://www.summersault.com/ . . . . . . .

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to