in reply to Is there an off-the-shelf Online Membership solution?
use MySite::SubClass; my $webapp = MySite::SubClass->new(); $webapp->run();
package MySite::SubClass; use MySite::SuperClass; sub setup { # setup runmodes and script specific stuff # ...templates perhaps? } # … # runmodes subs and whatnot :) # … 1;
You can then create MySite::SubClass2 (etc…) which all use MySite::SuperClass and thus have session management taken care of.package MySite::SuperClass; use base 'CGI::Application'; use CGI; # other modules here.. sub cgiapp_init { my $self = shift; # create database handler # do session management } sub teardown { my $self = shift; # dbh->disconnect } # … # other functions # … 1;
|
|---|