my $dbh = DBI->connect(...); my($max_foo) = $dbh->selectrow_array(q{ SELECT MAX(foo) FROM bar });