print "Writing file...\n"; open FILE, ">test.txt" or die $!; my $line = join "\t", (1..1000); print FILE $line, "\n" for (1..600); close FILE; print "File written!\n"; # Original method open PROFILES, ") { @profile = split (/\t/, $_); while ($j <= $#profile) { $matrix[$j]->[$i] = $profile[$i]; $j++; } $i++; $j = 0; } print "Original method takes ", time-$start, " seconds\n"; close PROFILES; # my method open PROFILES, "){ push @matrix, [split"\t"]; } print "My method takes ", time-$start, " seconds\n"; close PROFILES; # Blakem's method open PROFILES, "; print "Blakem's method takes ", time-$start, " seconds\n"; close PROFILES; __DATA__ C:\>perl matrix.pl Writing file... File written! Original method takes 18 seconds My method takes 7 seconds Blakem's method takes 52 seconds