in reply to Re: File searching *
in thread File searching *

Thanks Dave for the comment. !~ m/\.log$/ is working. Apparently you bring up a good point where $name.".log" is extra effort while the right condition has been included it.

For the suggestion to avoid reaadir and while loop, since I cannot sure which file would exist to be searched, and I need to print out whose additional files which not in the spec defined. How would I defined the condition in 'foreach' ?

if (-e 'abc' && -d _) { foreach my $entry (#other than <*.log>) { print OUTPUT ":E: $entry5 is extra file/dir \n"; } }