in reply to Yet another "why CGI-Application" question
Have you looked at
Obviously, don't just read. Write code and experiment, that's the best way to learn. OOP isn't that hard, and is well worth learning.
Update: BTW, the approach you are already using is very sensible. Here is one way to break out the run-modes (untested):
In each package create a sub called handler that looks like:use strict; use CGI; # or CGI::Simple my %dispatch = ( runmode1 => 'My::Package1', runmode2 => 'My::Package2', runmode3 => 'My::Package3', ); my $rm = $q->param('rm'); eval "require $dispatch{$rm}" or die "runmode handler not found"; $dispatch{$rm}->handler($q);
sub handler { shift; # ignore 1st arg (package name) my $q = shift; ... # do what ever runmode requires # return html output }
May the force be with you :)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Yet another "why CGI-Application" question
by punkish (Priest) on Nov 28, 2004 at 17:26 UTC | |
by Arunbear (Prior) on Nov 28, 2004 at 17:42 UTC | |
by perrin (Chancellor) on Nov 28, 2004 at 18:27 UTC | |
by tilly (Archbishop) on Dec 05, 2004 at 12:35 UTC |