Hmmm, nevermind.
Actually, I agree with your LoL remark. Returning a flat list seems too low level. Plus, if for any reason a new field needs to be added, so the number is no longer 5, it would break all code using it.
Modified, the code could look like:
my $diff= easy( \@a, \@b );
foreach ( @$diff ) {
my( $same, $aMin, $aMax, $bMin, $bMax )= @$_;
... # rest of code snipped because unaltered
}
or
my $diff= easy( \@a, \@b );
while (my $row = shift @$diff ) {
my( $same, $aMin, $aMax, $bMin, $bMax )= @$row;
... # rest of code snipped because unaltered
}
Never mind the extra overhead (if any)... No?