I'm liking this thread. But I have some elementary questions:
> package My::MainApp;
>
> use base qw/My::BaseApp/; # I already have this one; it handles sessions
> etc
> use My::MainApp::Admin; # contains the run modes dealing with admin
> functions
> use My::MainApp::News; # another example package of run modes
>
> # rest of app follows
> # this app still has some runmodes of its own, but most have been moved
> # into the packages use()d above.
>
> 1;
1) The above is *not* your base program, right? So what is it doing? I
understand base has all the cgiapp_xxxx stuff and your setup. And I
understand that ::Admin and ::News are doing specific functions, but this
inbetween module is unclear.
2) Also, in your sub import {} are you only importing the run modes for
that module (I assume)? My real question is, then, do ALL the runmodes
still get listed in the base module?
3) How are these files named when they are saved to the server? Just
"Admin.pm"?
Thanks!
>
>
> package My::MainApp::Admin;
>
> use CGI::Application; # to get the callback functionality
> use base qw/Exporter/;
>
> sub import
> {
> caller()->add_callback( 'prerun' => sub {
> my $self = shift;
> $self->run_modes([qw/
> save_user
> delete_user
> /]);
> } );
> goto &Exporter::import;
> }
>
> sub save_user {} # these used to be a run mode in MainApp
> sub delete_user {} # but are now in their own package
>
> 1;
>
>
> Hope that helps a bit :)
>
> Rhesa
>
> ---------------------------------------------------------------------
> Web Archive: http://www.mail-archive.com/[email protected]/
> http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
---------------------------------------------------------------------
Web Archive: http://www.mail-archive.com/[email protected]/
http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]