local *IN; open(IN, "/var/tmp/myfile.dat") or die "Can't read /var/tmp/myfile.dat: $! \n"; binmode(IN); my $buf_e = ''; my $buf_d = ''; my $BLOCK_SIZE = 8192; my @recs; # Shove the contents of file into an array while (sysread(IN, $buf_e, $BLOCK_SIZE, length($buf_e))) { push(@recs, [ $1, $2, $3, $4, $5, $6, $7, $8 ]) while ($buf_d =~ s/^(\S+)\t+(\S+)\t+(\S+)\t+(\S+)\t+(\S+)\t+(\S+)\t+(\S+)\t+(\S+)\n//s); } close(IN); print @recs;