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; $sql = "SELECT max(unxtmstmp) FROM logfl"; $sth=$dbh->prepare($sql) or die "preparing: ",$dbh->errstr; $sth->execute or die "executing: ", $dbh->errstr; @$d = $sth->fetchrow_array; print "@$d";