in reply to How to read batches of SQL from a file in Perl
You can also make the iterator a little simpler by changing the record separator:
The disadvantage is that $/ can't be a regex, so you can't handle upper/lower case, for example.local $/="\ngo\n"; while(<IN>) { chomp; # now the entire statement is in $_... ... execute the SQL statement, with error checking, etc. }
Michael
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: How to read batches of SQL from a file in Perl
by KurtSchwind (Chaplain) on Oct 25, 2007 at 02:05 UTC | |
by erix (Prior) on Oct 25, 2007 at 14:32 UTC | |
by mpeppler (Vicar) on Oct 26, 2007 at 14:02 UTC |
In Section
Cool Uses for Perl