Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re^2: file comparison

by Marshall (Canon)
on Jun 27, 2009 at 14:55 UTC ( [id://775329]=note: print w/replies, xml ) Need Help??


in reply to Re: file comparison
in thread file comparison

one thing to consider in the below code is that a "directory" is a file. This means the "." and ".." are files too! I congratulate you on using readdir rather than "globbing". This is much more portable and is the right way to go. I would put a grep to filter to the "real files",
opendir(DIR, $RemoteSubDirectory); my @rFileCheck = grep {-f $RemoteSubDirectory/$_ }readdir(DIR);
Remember that readdir only gives file names and you have to add the path... Your code:
opendir(DIR, $RemoteSubDirectory); my @rFileCheck = readdir(DIR); closedir(DIR);

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (4)
As of 2024-04-19 12:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found