forgot to clarify the code's purpose
I'm sorry I forgot to mention in the title what those sql statements were. I'm not fetching anything from the database using this code. I'm issuing statements to create sql tables and such to postgresql using the DBI....
User Profile
Collapse
-
solved
I've solved this problem since I last posted here. Thanks for the response though. Here's what I used:
Code:my $line = ""; my $currentCommand = ""; while(defined($line = <SCHEMA>)) { $line =~ s/[\t\n]*//g; # append to the current sql command $currentCommand = $currentCommand . $line; if($line =~ /;/) { # this line ends an sql command,
Leave a comment:
-
splitting a file by a character
I got a multiline SQL file that I would like to split by ; and read into an array. However when I try to do
Code:my @array = split(";", <FH>);
Does anyone know how they would get the array of sql statements (and no new lines)?
No activity results to display
Show More
Leave a comment: