Think about Loose Coupling | |
PerlMonks |
Re: Am I on the right track?by AnomalousMonk (Archbishop) |
on Jun 19, 2015 at 00:31 UTC ( [id://1131092]=note: print w/replies, xml ) | Need Help?? |
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 Section
Seekers of Perl Wisdom
|
|