in reply to Quickly reading the first line of a large number of files...
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
|
|---|