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

Re^5: file comparison

by ramlight (Friar)
on Jun 26, 2009 at 21:00 UTC ( #775176=note: print w/replies, xml ) Need Help??

in reply to Re^4: file comparison
in thread file comparison

Let's back up a minute and think about the problem.

To do the comparison, you need
- the file to be compared (file_a)
- the file to compare with (file_b)
- a method of doing the comparison

Given two lists of files (@file_a) and (@file_b), then you just need to take one from column a and one from column b, apply the comparision method, and check the result. For example you could:

$fa = shift(@file_a); $fb = shift(@file_b); if (digest($fa) == digest($fb)) # digest=whatever method you prefer # use eq instead of == if digest retur +ns a string { # files match }
So you have two separate problems: first generating the two lists of files so that the appropriate files match up in each list, then doing the proper digest.

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (3)
As of 2022-10-04 04:22 GMT
Find Nodes?
    Voting Booth?
    My preferred way to holiday/vacation is:

    Results (15 votes). Check out past polls.