- or download this
my @a= qw( a b c e h j l m n p );
my @b= qw( b c d e f j k l m r s t );
my @diff= easy( \@a, \@b );
- or download this
# @a @b @a @b
# same? range range values values
( 0, 0=>0, 0=>-1, # a !
...
1, 6=>7, 7=> 8, # l m = l m
0, 8=>9, 9=>11, # n p ! r s t
);
- or download this
my @a= qw( a b c e h j l m n p );
my @b= qw( b c d e f j k l m r s t );
my $diff= easy( \@a, \@b );
...
print "<b>$b</b>" if "" ne $b;
}
}
- or download this
<s>a</s>bc<b>d</b>e<s>h</s><b>f</b>j<b>k</b>lm<s>np</s><b>rst</b> - or download this
$_ .= $/ for @a, @b;
my $diff= easy( \@a, \@b );
while( @$diff ) {
...
}
}
}
- or download this
-a
b
c
...
+r
+s
+t
- or download this
my $diff= easy( \@a, \@b );
while( @$diff ) {
my( $same, $aMin, $aMax, $bMin, $bMax )=
...
print "> $_";
}
}
- or download this
1,1d0
< a
3a3,3
...
> r
> s
> t
- or download this
sub easy
{
my $a= shift; # array ref
...
splice @diff, 0, 5 if $diff[2] < 0 && $diff[4] < 0;
return wantarray ? @diff : \@diff;
}