http://www.perlmonks.org?node_id=205067

stew has asked for the wisdom of the Perl Monks concerning the following question:

Hi
I am trying to run thru a directory of PDF's, read each one in turn into memory and then store them in MySQL

I get thru about 8 or so when I get the following error

DBD::mysql::st execute failed: MySQL server has gone away at insert_pd +f.pl line 76. de140202.pdf


My query looks like this

my $sth = $dbh->prepare(q{insert into ee_pdf(id,data) values (?,?)});

I am reading the pdf like this
open(FILE,"<".$filename) || die ("Could not open FILE"); @file_arr = <FILE>; close(FILE); foreach $line(@file_arr) { $data .= $line; }


And executing the query thus..

$sth->execute($id,$data);

Any idea why this might be?
Stew