$ cat /tmp/j1.pl #!/usr/bin/perl use strict; use warnings; while (<>) { chomp; my $stat = `stat $_`; } $ cat /tmp/j2.pl #!/usr/bin/perl use strict; use warnings; while (<>) { chomp; my $stat = stat $_; } $ cd path/with/12.6K_files/ $ ls | time /tmp/j1.pl 60.05 real 12.76 user 31.45 sys $ ls | time /tmp/j2.pl 0.07 real 0.01 user 0.02 sys