in reply to Parsing large files

I tried the same thing on my UNIX machine to see what the difference might be, and I couldn't come up with anything. So, keep a few things in mind about Windows (partially OT, as it's more process maintenance and windowsism from this point on, but in this case, one may need to think outside the shebang):

Here is the code I used, you may wish to do the same:
#!/usr/bin/perl -w use strict; my $n=0;open(OUT,">$n.out"); while(<>) { print OUT or die "Lost file handle\n"; if (/foo/) {close(OUT);$n++;open(OUT,">$n.out") or die "Can't get file handle\n";} } print "Reached EOF\n"; close(OUT);
I used some web logs to test it, and it was fine. No huge memory consumption (and these are big logs), just did what it was supposed to do. If you are using Windows 2000 or NT, load up the process viewer and add in a file handles view, to make sure it isn't leaking them. Try the sleep(). Who knows, being a better OS citizen may actually work.

Good luck.