astroboy has asked for the wisdom of the Perl Monks concerning the following question:
Hi - is there a ready-made module or a simple way to run SQL scripts from Perl? Generally, I want to execute Oracle statements without using SQL*Plus, or MySQL statements without using the mysql shell etc. Up until now, I've simply been splitting on the semi-colon statement terminator, but this has the potential to be quite brittle -- SQL statements can contain comments, the statement terminator could be inside strings and hence should be ignored, the comments could be inside strings and hence ignored too, etc. Recommendations, ideas appreciated.
Querylet might come close, with the statements separated by ;, at least if your DBD handles multiple statements. Otherwise, I've often used split /;\n/ together with DBI/$dbh->do.