[ic] Database Handle and Global Subs

Sheamus Nulty interchange-users@lists.akopia.com
Fri Jun 8 07:38:00 2001


I trying to run a database query in a global tag but am running into a
problem with getting access to the database.
I'm using the following code

sub test{

use DBI;

my $dbh = DBI->connect("DBI:mysql:$dbname", $dbuser, $dbpasswd);
.....

}

and I get an error saying

Can't locate object method "connect" via package "DBI" at (eval 91) line 14.

Can anybody shed some light on why this won't work.

Thanks

Sheamus