On Thu, 7 Jun 2001, Peter Cornelius wrote:
> use Benchmark;
> opendir (DH, ".") or die;
> timethese(50000, {
>       'Randals' => q{my @result = <*.jpg>},
>       'variations' => q{my @result = grep /\.jpg$/i, readdir DH}
> });
> closedir(DH)

This only reads the directory in once for the 'variations' subroutine, as
once the files are pulled in by readdir(), it returns immediatly.

--
Ian

Reply via email to