APM: OOP question
Wayne Walker
wwalker at broadq.com
Sat Sep 13 20:47:21 CDT 2003
In my example, Foo::Bar and Foo::Baz are sub classes of Foo. They would
have "@ISA = qw(Foo)" or "use base 'Foo';" in them. I just accidentally
left that out of my example below.
On Sat, Sep 13, 2003 at 07:31:44PM -0500, Wayne Walker wrote:
> I have an issue about inheritance and Class methods (rather than object
> methods). Any help would be appreciated.
>
> For those of you who didn't ace telepathy 305, here's the code:
>
>
> $miracle = Foo::Bar::get_data();
>
>
> package Foo;
>
> sub get_data
> {
> my $class = shift; # this will = Foo::Bar at runtime
> $magic_dust = $class::get_dust();
> $miracle = convert($magic_dust);
> return $miracle;
> }
>
> package Foo::Bar
>
> sub get_dust
> {
> # stuff....
> return convert($beans);
> }
>
>
> The problem is that I cannot get the syntax right to run
> Foo::Bar::get_dust() inside Foo::get_data().
>
> There will also be Foo::Baz::get_dust().
>
> Applications will call the non-existant Foo::Baz::get_data
> Foo::Bar::get_data, etc...
>
> --
>
> Wayne Walker
>
> www.broadq.com :) Bringing digital video and audio to the living room
> _______________________________________________
> Austin mailing list
> Austin at mail.pm.org
> http://mail.pm.org/mailman/listinfo/austin
--
Wayne Walker
www.broadq.com :) Bringing digital video and audio to the living room
More information about the Austin
mailing list