I need to convert a document of SQL statements to a ColdFusion document. I only have a little experience with Regular Expressions and I am Perl super-newb (I just taught myself
You can take advantage of the fact that the individual sql statements in your input file are terminated by a semi-colon character. Set the record input separator to a semi-colon $/ = ';'
in your perl script and then it will read one complete sql statement on each read of STDIN, regardless how many actual lines it spans.
#!/usr/bin/perl -w
use strict;
$/ = ';';
my $num = 0;
while (my $sql = <>) {
$sql =~ s/^\s+//;
printf "\n" if $sql;
}