MrMadScience has asked for the wisdom of the Perl Monks concerning the following question:
to look for the lines shared by the two. I have written a perl script to read each file into an array, and I would like to use the arrays to find what is common to the two files and then work with both what is and is not common. Other than using the grep module, what would be the best way to do this?foreach line ( ` cat file1` ) grep $line file2
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Comparing two file in Arrays
by skx (Parson) on Jan 02, 2004 at 18:24 UTC | |
by graff (Chancellor) on Jan 03, 2004 at 04:25 UTC | |
|
Re: Comparing two file in Arrays
by duff (Parson) on Jan 02, 2004 at 17:35 UTC | |
by MrMadScience (Acolyte) on Jan 02, 2004 at 18:00 UTC | |
by tachyon (Chancellor) on Jan 03, 2004 at 04:40 UTC | |
|
Re: Comparing two file in Arrays
by jonnyfolk (Vicar) on Jan 02, 2004 at 18:23 UTC | |
|
Re: Comparing two file in Arrays
by DrHyde (Prior) on Jan 02, 2004 at 19:32 UTC | |
by Steve_p (Priest) on Jan 02, 2004 at 19:43 UTC | |
by DrHyde (Prior) on Jan 02, 2004 at 22:32 UTC | |
by tachyon (Chancellor) on Jan 03, 2004 at 04:43 UTC |