In our product, we have a large utility file that we need (with do) at the beginning of a large number of our files. Is there any reason not to turn this into a module? For example, instead:
do '../dbi_utilities.pl'; our ($db,$user,$pw,$attr); my $Data = DBI->connect($db,$user,$pw,$attr) or die "Could not connect to database: $DBI::errstr";
Can't I just do it ?:
use AppUtil; my $Data = AppUtil->connect();
What are the pros and cons of each style?
module perl use
Frew schmidt
source share