use strict; use warnings; use DBI; # Here's how to include the DBI module my $dbh; my $db = 'myfirstdatabase'; my $db_user = 'RAM'; my $db_password = ''; # Connect to the requested server $dbh = DBI->connect("dbi:mysql:$db","$db_user", "$db_password",{RaiseError => 0, PrintError => 0} ) or err_trap("Cannot connect to the database"); my $sql; my $sth; my $td; $sql = "SELECT max(unxtmstmp) FROM logfl"; $sth=$dbh->prepare($sql) or die "preparing: ",$dbh->errstr; $sth->execute or die "executing: ", $dbh->errstr; $td = $sth->fetchrow_array; print "$td"; #### C:\ram>perl timeinblt.pl Can't locate object method "connect" via package "DBI" (perhaps you forgot to load "DBI"?) at timeinblt.pl line 14. C:\ram>