in reply to Re^2: string diff and comparein thread string diff and compare
my ( $rold, $rnew ) = map scalar reverse, $old, $new;
Is just a different way of saying:
my $rold = reverse $old;
my $rnew = reverse $new;
You need to use scalar because reverse is in list context in the map expression.
There are other ways of enforcing scalar context which are a lot more fun. :-)
use 5.010; use strict; use warnings all => 'FATAL';
my ( $old, $new ) = qw( old new );
my ( $rold, $rnew ) = map~~reverse, $old, $new;
"$old => $rold",
"$new => $rnew";
Once (shame on you!)
Twice (shame on me!)
More often than I'd like to be
All the time
Just when answering stupid polls
Who you callin' a fool?
I refuse to vote in this ridiculous poll
Results (526 votes). Check out past polls.