I think your solution is actually better because -e will return true for a directory too. So-
next if not -f $fname; # or the somewhat too dense warn "$fname is not a file" and next unless -f $fname;
In reply to Re^2: if file does not exist
by Your Mother
in thread if file does not exist
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |