surajsam has asked for the wisdom of the Perl Monks concerning the following question:
This could be more of unix question too. Since I am dealing with 'diff' within a perl script, thought of asking here.
foreach $f (@isect) { print "diffing file $f \n"; system("diff -r $some_dir/$f $other_dir/$f" ); }
isect array contains common elements of two other arrays (directories). when I do a diff between two directories for all the elements of isect, I want to ignore the identical elements (files). I want the diff to report only those files that differ.
for example one sample output would look like, as follows -
Intersect Array = 4 3 diffing file 4 4d3 < 1111 diffing file 3
In the above example, I don't want "diffing file 3" to be printed, since 'file 3' is an identical file between two arrays. I want to ignore files with no diff. I was looking for a switch for the diff command and did not find any. BTW, I don't have Diff.pm in my environment and that possibility is ruled out. Appreciate any help
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Dealing with diff command within perl
by Corion (Patriarch) on Nov 26, 2011 at 09:20 UTC | |
by bart (Canon) on Nov 26, 2011 at 20:59 UTC | |
by surajsam (Initiate) on Dec 03, 2011 at 03:36 UTC | |
by surajsam (Initiate) on Dec 03, 2011 at 03:39 UTC | |
|
Re: Dealing with diff command within perl
by jethro (Monsignor) on Nov 26, 2011 at 01:40 UTC | |
by mbethke (Hermit) on Nov 26, 2011 at 17:58 UTC |