There's more than one way to do things | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Fellow Monks, My program calls a large (200 lines) internal subroutine about 1/3 of the time the script is run. The subroutine requires 4 arguments to run and returns a AoH ref for output to HTML::Template. To complicate matters, it calls other sub routines (5 and 10 liners that are only needed by that large sub) to perform basic formatting tasks, etc. So, things currently look like:
Questions: 1) do I leave it as is? (seems messy) 2) do I spin off the large sub and it supporting subs as a module? (modules always get loaded) 3) do I use Selfloader to avoid loading all those subs? (subs stay in main script, but don't always get loaded) 4) What is the cleanest, most efficient, most readable solution? Thanks! —Brad "Don't ever take a fence down until you know the reason it was put up. " G. K. Chesterton In reply to Program structure: subs vs modules vs Selfloader by bradcathey
|
|