I am trying to do the following in my perl script:
Compare 2 directories
#First compare, write "Only in" results to a file.
system "diff --recursive --brief test1/ test2/ | grep 'Only in' > outputOnlyInFile";
#Second compare, write "Files are different" results to a file.
system "diff --recursive --brief test1/ test2/ | grep 'differ' > outputDifFile";
However, here are the problems I am having with this approach:
1. Doing 2 diffs - too slow. Solution: break it down to one diff then write "Only in" and "differ" lines to 2 different files.
2. There are different versions of diffs - on solaris and linux. I believe the solaris 2.9 version of diff does not support the "--recursive" and "--brief" options.
What I would like to do is compare the directories without using the diff utilility.
How could I attempt to do this in perl? Are there perl modules I could use which would do this?