That is, because you are doing closedir before readdir. If you were running under use warnings;, Perl would have given you an error message like
readdir() attempted on invalid dirhandle $dh at test-m.pl line 5.
In reply to Re^3: list files based on age and pattern
by hdb
in thread list files based on age and pattern
by kaka_2
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |