$dbh->do("insert ... "); $sth = $dbh->prepare('select @@identity'); $sth->execute(); my $data = $sth->fetch;...