in reply to Reading a directory into an array using <>

If you use warnings, you should get a warning message like:
readline() on unopened filehandle at ...
Also, if you use diagnostics, you should get a little more help on that message:
readline() on unopened filehandle at ... (#1) (W unopened) An I/O operation was attempted on a filehandle that w +as never initialized. You need to do an open(), a sysopen(), or a so +cket() call, or call a constructor from the FileHandle package.
Well, those might not be the most helpful messages to you, but at least they give you an idea that something is amiss. To avoid the voodoo of <>, use glob:
use warnings; use strict; my $path = '/var/log/*'; my @files = grep { -f } glob $path;
See also: