Could this be a permissions issue?
Try changing your error message on the opendir to "Cannot open dir: $!" to see the details of what went wrong.
Try prefixing your code with the line: warn "Can't read /opt/tmp\n" unless -r "/opt/tmp";
Also, in general, you should use warnings; use strict; at the top of your scripts if you aren't already.
In reply to Re: Perl List files in directory
by Anonymous Monk
in thread Perl List files in directory
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |