in reply to ?? Blazes under Linux; crawls under XP & Win2K...

In addition to advice regarding only opening the output files once, an extra speed increase could be gained by using unpack instead of substr:
use strict; use IO::File; $|++; my $sourcefile = 'data.txt'; my @possibletargets = qw(1 2 3 4 5); my %tgthandles = (); foreach my $target (@possibletargets) { my $fname = 'form_' . $target . '_record.txt'; $tgthandles{$target} = IO::File->new(">>$fname"); } open(REPORTS, $sourcefile); while(<REPORTS>) { my $line = $_; my $id = unpack("A1A*", $line); my $fh = $tgthandles{$id}; print $fh $line; } close(REPORTS); foreach my $key (keys(%tgthandles)) { $tgthandles{$key}->close; }