The ... or die does not make sense when used in list context.
The cause you get your error is most likely because the readdir does not return any files. Maybe you meant
readdir DIR;
... instead of a bare readdir?
In reply to Re^5: Perl List files in directory
by Corion
in thread Perl List files in directory
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |