go ahead... be a heretic | |
PerlMonks |
Re: CGI::Application with 'main' runmodes and 'sub' runmodesby Herkum (Parson) |
on Apr 28, 2007 at 14:25 UTC ( [id://612553]=note: print w/replies, xml ) | Need Help?? |
Suggestions,
Example: instance script at /Sample/Launcher/Default.cgi
Now you know where every controller module is based upon the name of instance script. It provides consistency. This would be your Main module.
This sets you with some initial defaults. Now lets take advantage of this by inheriting its properties but and change the default path that is appropriate for that controller.
Thats it! Your Sample::Launcher module has two run modes (One and Two), and can find the templates in '/Sample/Launcher/One.tmpl' and '/Sample/Launcher/Two.tmpl' . Notice, no redundancy! :) Try that and see if it is not better for you.
In Section
Seekers of Perl Wisdom
|
|