SPUG: Interdependance of package subroutines

Ken Clarke kenslinux at shaw.ca
Thu May 19 11:36:12 PDT 2005


Hi Folks,

    I'm building a library of subroutines, separated into functionally 
grouped packages, for use in CGI scripts and cron jobs.  I'm finding that as 
the library grows more and more I want subroutines from one package to be 
available for use in another package, so I'm either calling them by their 
package qualified names [ eg my $result_hashref = 
&MyPackage::my_sub(\%sub_args); ], or if they've been imported into package 
main, directly from there [ eg my $result_hashref = 
&main::my_sub(\%sub_args); ].

    I would appreciate hearing your comments on the wisdom of this strategy 
from an architectural standpoint.  Testing on various platforms shows that 
everything works as intended but I'm getting an uneasy feeling that there 
may be pitfalls which I am not seeing.

    I'd also appreciate recommendations for articles, books etc which 
examine architectural/structural issues of medium to large scale 
applications.

    Thanks for your time.

>> Ken Clarke
>> Contract Web Programmer / E-commerce Technologist
>> www.PerlProgrammer.net



More information about the spug-list mailing list