in reply to Trying to process some text...
Try something like this (and note the extra error handling):
To get SQL errors reported, use {RaiseError => 1} when you make the connection. See the DBI doc for details.my $sth = $dbh->prepare(<<"SQL"); INSERT INTO main (operations,seconds,usr,sys,cpu,tests) VALUE (?,?,?,?,?,?) SQL open(IN, "<$input_file") or die "$input_file: $!"; while ( <IN> ) { chomp; # remove the trailing \n my($operation, $seconds, $usr, $sys, $cpu, $tests) = split; $sth->execute($operation,$seconds,$usr,$sys,$cpu,$tests); } close(IN);
|
|---|