![]() |
|
Perl: the Markov chain saw | |
PerlMonks |
Re: limit output filesizeby Forsaken (Friar) |
on Jul 09, 2005 at 05:37 UTC ( #473643=note: print w/replies, xml ) | Need Help?? |
i'm anything but an expert, but I would likely go for a solution where I used a single scalar to keep track of how many bytes were already written, and before each write check if ($bytes_written + $current_line) > 51200. If that's the case, hang on to $currentline for the moment, close the file I was writing to nice and tidy and open the next one. Might be tedious, but it's simple :-) Not sure how efficient it would be though.
Remember rule one...
In Section
Seekers of Perl Wisdom
|
|