local $/ = ";\n"; while ( <> ) { s/^#.*$//mg; # kill comments s/^\s+//; # kill all remaining leading whitespace print "Query: $_\n"; }