If you mean that you need to create your db handle in your program and use it in your module, then you can just pass the handle to your module's
new method.
#!/usr/bin/perl -w
use DBI;
my $dbh = new DBI->connect(...);
my $pkg = new MyModule($dbh);
##############################################
package MyModule;
sub new {
my ($dbh) = @_;
my $self = ();
$self{dbh} = $dbh;
...
}
sub MyMethod {
my ($self) = @_;
# use the db handle something like this
$self{dbh}->quote(...);
...
}
--
hiseldl
"Act better than you feel"