my $sqlString = 'delete from %s;'; $dbh->begin_work; my @tables = ('table1','table2','table3'); foreach my $table (@tables) { my $sth = sprintf($sqlString, $table); $dbh->do( $dth ); } $dbh->commit;