> I use a base class to handle authentication for my application.
> It contains the cgiapp_init() and cgiapp_prerun() functions to read the
> user ID and to set up the database handle, and a setup() function which
> defines runmodes for 'accessdenied' and 'noconnection'.
>
> The derived class says: use base 'MyPackage::Session', and the base
> class ('Session') says 'use base 'CGI::Application'. I do not meddle
> with @ISA.

Does the derived class never call its own setup() or run_modes()?  If not,
then the run_modes from that class aren't getting registered as valid mode
names, which causes your error ("No such run-mode 'noconnection'").

I can think of two possible solutions:

1) invoke the parental setup() inside the child's setup(), either using
SUPER
or just a fully-qualifed method name (i.e. $self->MyPackage::Session::setup
();)

2) if the parental setup() is only being used to register the names of
these
run modes, you could skip the parental setup() entirely by just putting
these
names in a global variable in the parent class, and incorporate that
variable
in the child's invocation of run_modes().  E.g.:
   $self->run_modes([qw(foo bar), @MyPackage::Session::runmodes]);

-- Mike F.





---------------------------------------------------------------------
Web Archive:  http://www.mail-archive.com/[EMAIL PROTECTED]/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to