i have 2 different apps that use CGI::Application, and i want to reuse some of the common methods ...
after reading A question of inheritance, it might be that the inheritance tree isn't right ... but here's the code in question:
normal setup, no?package FlierAdminReports; use strict; use base qw/ FlierReports /; sub setup { my $self = shift; $self->start_mode( 'options' ); $self->mode_param( 'rm' ); $self->run_modes( options => \&searchOpts, summary => \&orderSummary, ); }
i have a run-mode of 'detail' in FlierReports ( the 'superclass' ) ... but it's not being found.
the attempt is to use the "detail" run mode in the subclass ( FlierAdminReports.pm ), but it get:package FlierReports; use strict; use Data::Dumper; use base qw/ FlierFunctions /; sub setup { my $self = shift; # Setup the run mode stuff $self->start_mode( 'openOrders' ); $self->mode_param( 'rm' ); $self->run_modes( openOrders => \&openOrderSummary, detail => \&openOrderDetail, markDone => \&markFinished, ); }
so i need to export the subroutine? i've tried declaring the run-mode, not declaring the run-mode ( in the subclass )... nothing does "the right thing" ....No such run-mode 'detail' at /usr/lib/perl5/site_perl/5.8.0/CGI/Appli +cation.pm line 133
In reply to CGI::Application and inheritance by geektron
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |