You could/should add the "prefix" option in the read_dir statement so that the path will be prepended to the filename.
@files = read_dir($ARGV[0], prefix => 1);EDIT:
I'd probably reduce your code a little, like this:
my $path = $ARGV[0] || '.'; my @files = read_dir($path, prefix => 1); for my $file (@files) { say -f $file ? "$file is a file" : "$file is a dir"; }
In reply to Re: read_dir issue
by fishmonger
in thread read_dir issue
by snowlight
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |