open(INPUT, '<', 'Path/file_with_updates.sql') or die ("Error opening file with updates: " . $!); while () { $dbh->do($_) or die("Error executing query [$_]: " . $dbh->errstr); } close(INPUT);