Thanks
rafael.
I was just looking for a way to compare files as strings and found File::Compare a bit lacking.
Looks like someone else besides me would like an
option to ignore
differences in number of whitespaces. Other options I
often use with the Unix diff utility include those to
use Text::Tabs; use Test::More tests => 1; use Test::LongString;
# Apply one or more filters. # N.B. The order in which the filters are applied matters:
my @strings = map {tr/\n\r\f / /s; $_} map expand($_) => map lc($_) => ;
is_string( $strings[0], $strings[1], 'Actually differs by one char' );
__DATA__ This is a test of Test::LongStrings this is a test of Test::longstring
while (length($x) && length($y)) { - my ($x1,$x2) = $x =~ /(.)(.*)/s; - my ($y1,$y2) = $y =~ /(.)(.*)/s; + my $x1 = substr($x, 0, 1, ''); + my $y1 = substr($y, 0, 1, ''); if ($x1 eq $y1) { - $x = $x2; - $y = $y2; ++$r; }