#! perl -slw use strict; sub map2 (&@) { use Carp; my $code = shift; croak 'Odd number of values in list' if @_ & 1; map { local ($a, $b) = (shift,shift); $code->() } 1 .. (@_>>1); } sub cmpVer{ eval{'v'.$_[0] cmp 'v'.$_[1];} } # << This is the salient bit my @a = qw[ 1.1.1 1.1.1 1.1.1 1.1.2 1.1.2 1.1.1 1.1.10 1.2.0 0.111.0 9.0.0 9.0.0 0.111.0 1.4.999 1.5.0 ]; map2{ printf "%10s %2.2s %s\n", $a, (qw/== > 228707 1.1.1 == 1.1.1 1.1.1 < 1.1.2 1.1.2 > 1.1.1 1.1.10 < 1.2.0 0.111.0 < 9.0.0 9.0.0 > 0.111.0 1.4.999 < 1.5.0 C:\test> #### map2{ print $a, $b; } qw[a b c d];