in reply to Structure of Perl CGI code

This is quick, and just my $0.02, but..

I like the concept of modes.
Think /cgi-bin/script.pl?mode=order

Then, you can do many things..
Create a hash with references to subroutines, and..
my %mode_hash = (order => \&mode_order, confirm =>\&mode_confirm); my $mode = param('mode') || "order"; #default mode &{$mode_hash{$mode}}; # executes the mode subroutine
I know there is more than one way to call the subroutine in the mode hash, but like I said, this is just spilled out from memory.

Anyway, that scales here at work. We have a similar approach, using mod_perl and Apache. The intranet here is huge, and it seems to provide (the dev team, at least) with understood and managable code....

_14k4 - perlmonks@poorheart.com (www.poorheart.com)