Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re^2: Handling Hash Comparison

by omega_monk (Scribe)
on Jul 23, 2005 at 04:09 UTC ( [id://477419]=note: print w/replies, xml ) Need Help??


in reply to Re: Handling Hash Comparison
in thread Handling Hash Comparison

no, I posted my code in the readmore tags, in my original post. What happened is that initially I was only doing this in the dir that was specified at the command line, but later decided to add the ability to recurse dirs. my original code concatenated the dir onto the $key so that it copied appropriately, but when I added recursion, I could not longer copy the files in the same way, problem is I have no idea how best to proceed.

Take a look at the rest of my code? Thanks.

update: apologies, if that came off inappropriately, I was really just meaning to ask to have another look. Thanks for the pointer, I will take a look at File::Find:dir. One question, though. Does the logic make sense to get the filename for the second dir? I am probably just missing something obvious. I appreciate the help. Thanks again.

Replies are listed 'Best First'.
Re^3: Handling Hash Comparison
by Errto (Vicar) on Jul 23, 2005 at 04:16 UTC
    Ok. I posted an update above - basically you can use $File::Find::dir instead of getcwd so that the relative path instead of the absolute path becomes the key. But now I'm unclear - I understand that if two files in corresponding relative paths have matching MD5 sums you want to do something, but I don't understand what that is. Right now what would happen is that you copy the file onto itself.
      exactly, and that is my issue, that I am not sure how I need to change the code to get the appropriate arguments to 'cp'.
        So, I'm still not clear...what do you want it to do? In the OP you only said you wanted to compare MD5 sums of corresponding files. I don't see how copying fits into it.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (3)
As of 2024-05-27 05:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found