@cmds = split(/;/, $sql); # yes I know - that regexp won't do the right thing! foreach (@cmds) { $sth = $dbh->prepare($_); $sth->execute; etc... }