Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re^3: Finding un-paired files in a directory

by Coruscate (Sexton)
on Dec 02, 2003 at 21:26 UTC ( [id://311744]=note: print w/replies, xml ) Need Help??


in reply to •Re: Re: Finding un-paired files in a directory
in thread Finding un-paired files in a directory

Which is why globing can be so lovely, as it includes the file path for you :) I'm not sure if this is any faster than Abigail-II's solution. At least this does only check for the existence of each file once rather than two checks.

my $dir = '/path/to/dir'; print join ", ", grep { /(.*)\.mrg\z/ and not -f "$1.did" } <$dir/*\.mrg>'

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (6)
As of 2024-04-19 03:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found