Think about Loose Coupling | |
PerlMonks |
Re: Converting common subroutines as a moduleby Zaxo (Archbishop) |
on Nov 01, 2006 at 19:04 UTC ( [id://581734]=note: print w/replies, xml ) | Need Help?? |
Since your subs all seem to take a CGI instance as an argument, you could subclass CGI.pm as Site::CGI and use that instead of CGI.pm in the top level scripts. That would help prevent putting functions with dissimilar purposes in your Common.pm. The subclassing mechanism is not too difficult. The basic steps are: Save that file as Site/CGI.pm somewhere in your @INC path. You would then, in top level scripts, say,
After Compline,
In Section
Seekers of Perl Wisdom
|
|