In our product we have a big utilities file that we require (with do) at the beginning of a lot of our files. Is there a reason not to turn this into a module? For example, instead of doing this:
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";
Couldn't I just do this?:
use AppUtil;
my $Data = AppUtil->connect();
What are the pros and cons of each style?