in reply to Program structure: subs vs modules vs Selfloader
Also, serioulsy consider breaking the large sub into smaller ones!# Give largesub and its entourage their own module package ModuleWithLargeSub; sub smallsub { ...process... } sub largesub { my ($e, $f, $g, $h) = @_; my $foo = &smallsub($e); ...process... return \@AoH; } 1; # Then in the cgi script: #!/usr/bin/perl use strict; my $run_large_sub; ...etc... ...initiate variables... ...HTML::Template setup... my $AoH; if($run_large_sub) { require ModuleWithLargeSub; $AoH = ModuleWithLargeSub::largesub($a, $b, $c, $d); } $template -> param( todisplay => $AoH ); print $template->output(); exit();
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Program structure: subs vs modules vs Selfloader
by bradcathey (Prior) on Jun 20, 2004 at 17:31 UTC | |
by vek (Prior) on Jun 20, 2004 at 18:31 UTC |