grr. today's not my day.

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:

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, ); }
normal setup, no?

i have a run-mode of 'detail' in FlierReports ( the 'superclass' ) ... but it's not being found.

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, ); }
the attempt is to use the "detail" run mode in the subclass ( FlierAdminReports.pm ), but it get:
No such run-mode 'detail' at /usr/lib/perl5/site_perl/5.8.0/CGI/Appli +cation.pm line 133
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" ....

In reply to CGI::Application and inheritance by geektron

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.