in reply to please how can i split string that is over 5MB
in thread Inserting large chunks of data into MySQL

I take it that the error that you are getting coming from your web server that your perl script is running on as a CGI. If so, look at the server's error log to see what error message perl itself generated.

How are you reading $txtque (the one outside of the for loop) into memory in the first place? If it it coming from a file, you might try this:

open my $fh, '<', '/the/file/with/txtque' or die "unable to open ...: $!\n"; { local($/) = '~'; while (my $txtque = <$fh>) { my $count = $dbh->do(...); # execute the INSERT statement here } }
That is, read in one $txtque value at a time and execute the INSERT statement instead of reading in all of the $txtque values in before doing the inserts.

Replies are listed 'Best First'.
Re^2: please how can i split string that is over 5MB
by askgetanswer (Initiate) on May 04, 2008 at 20:27 UTC
    using memory