in reply to Comparing strings to extract the different words/expressions

Algorithm::Diff will operate on array elements. I use it to colorize differences inside lines.

If you will post some test cases, I can show you how it works.

Here's my simple colorizer, if that helps.

#!/usr/bin/perl use Algorithm::Diff qw(traverse_sequences); use Term::ANSIColor; use strict; use warnings; my @from = split //, shift // 'this is the left string'; my @to = split //, shift // 'this is the right string'; traverse_sequences( \@from, \@to, { MATCH => sub {print $from[shift()]}, DISCARD_A => sub {print color('red'), $from[shift()], color 'reset'} +, DISCARD_B => sub {print color('green'), $to[pop()], color 'reset'}, } ); print "\n";