my @files = grep {!/^\./ && -f "$dir"."data2/$_" } readdir($dh);
A small point: If you're trying to filter out the . and .. directories from what you are reading from the directory handle, be aware that !/^\./ will also filter out files named something like '.foo'. The idiomatic pattern to use here would be !/^\.\.?$/ or maybe m{ \A [.]{1,2} \z }xms instead.
Give a man a fish: <%-(-(-(-<
In reply to Re: Am I on the right track?
by AnomalousMonk
in thread Am I on the right track?
by Pharazon
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |