fletcher_the_dog has asked for the wisdom of the Perl Monks concerning the following question:
Note that if one element appears to have replaced another such as "burritoes" replaces "tacos", those elements are mapped together. I was wondering if there was some module out there that did something like this. I have been playing around with different algorthims, but I wanted to be sure I am not just reinventing the wheel.my @array1=qw(I like to eat tacos); my @array2=qw(Do you like to eat burritoes); my @diff=get_diff(\@array1,\@array2); @diff=( ['Do',0,0], ['you',1,0], ['like',2,1], ['to',3,2], ['eat',4,3], ['burritoes',5,4] );
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Diff between two arrays
by tilly (Archbishop) on Jul 01, 2003 at 16:13 UTC | |
by fletcher_the_dog (Friar) on Jul 01, 2003 at 17:02 UTC | |
|
Re: Diff between two arrays
by pboin (Deacon) on Jul 01, 2003 at 16:42 UTC | |
|
Re: Diff between two arrays
by apsyrtes (Beadle) on Jul 01, 2003 at 16:06 UTC | |
by fletcher_the_dog (Friar) on Jul 01, 2003 at 16:51 UTC | |
|
Re: Diff between two arrays
by dree (Monsignor) on Jul 01, 2003 at 19:20 UTC | |
|
Re: Diff between two arrays
by Skeeve (Parson) on Jul 02, 2003 at 06:29 UTC |