If on *nix system then maybe use the head command, something like my @lines = grep {/^#!/} `head -1 -q *`;but it depends on what you do with it if the overhead of the system call is justified by the quicker execution. Benchmark it ...
-- Hofmator
In reply to Re: Quickly reading the first line of a large number of files...
by Hofmator
in thread Quickly reading the first line of a large number of files...
by Snowman
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |