There's more than one way to do things | |
PerlMonks |
Re: How do i split a file into given number of parts.by mr_mischief (Monsignor) |
on Jun 23, 2001 at 01:29 UTC ( [id://90875]=note: print w/replies, xml ) | Need Help?? |
This solution takes as its first argument the number of ways to split a file, and the remainder of arguments are taken to be files which need to be split. It does not delete the originals.
Its weakness is it only loads one buffer per output segment, and for greater usability it should probably loop if it's a huge size. I don't see this being a huge problem given the nature of the program, though, because there's some place the split files are going that's too small for the original file, so the parts should be small enough for main memory. I'll therefore leave more exotic buffer manipulation as an exercise. Chris Boo!
In Section
Seekers of Perl Wisdom
|
|