in reply to CGI::Application and object inheritance
package Foo; use base qw(CGI::Application); use Bar; sub new { my $class = shift; # SUPER refers to CGI::App because of 'use base' my $self = $class->SUPER::new(); $self->{ stuff } = 'whatever'; $self->{ bar } = Bar->new(); # I wouldn't use 'super' as a key he +re return $self; } # etc ...
Now in your script:
use Foo; my $app = Foo->new();
... should have access to all of Foo's methods and all of CGI::App's methods
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: CGI::Application and object inheritance
by spork (Monk) on Jul 27, 2005 at 15:45 UTC | |
by cfreak (Chaplain) on Jul 28, 2005 at 03:55 UTC |