use DBI; my $dbh = DBI->connect( 'dbi:Mock:', '', '' ) or die $DBI::errstr; $dbh->{mysql_insertid} = 10; print $dbh->{mysql_insertid}, $/; ----- 10