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.package Site::CGI; use CGI; @ISA = qw/CGI/; # subroutine definitions, object instance is first arg # . . . 1;
You would then, in top level scripts, say,
use Site::CGI; # instead of use CGI; my $query = Site::CGI->new; # . . . print $query->my_sub; # etc
After Compline,
Zaxo
In reply to Re: Converting common subroutines as a module
by Zaxo
in thread Converting common subroutines as a module
by sara2005
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |