Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
Re^4: How to split big files with Perl ?by Anonymous Monk |
on Dec 26, 2014 at 21:41 UTC ( [id://1111434]=note: print w/replies, xml ) | Need Help?? |
I see you've updated your original node, but haven't marked it as updated. Please don't do that since now some of the replies don't make sense anymore, see here. This is still not correct: my $split_fh = $fh . 'split'; #creates 'filename.split' - don't use $fh, the filehandle, use a variable containing the filename here. Also print $out_file, $buf; - remove the comma. Reading the file one byte at a time is a slightly better approach than 2GB at a time, but probably still not very efficient - a buffer size of at least a few kilobytes will probably get you better performance.
In Section
Seekers of Perl Wisdom
|
|