Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re^2: File searching *

by michael99 (Acolyte)
on Mar 02, 2020 at 04:29 UTC ( #11113617=note: print w/replies, xml ) Need Help??


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"; } }

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://11113617]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (5)
As of 2020-11-30 11:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?