#!/usr/local/bin/perl

use Benchmark ;

my @in = map rand 50000, 1 .. 1000 ;

timethese( shift || -2, {

	plain => sub { my @out = sort { $a <=> $b } @in },

	slice => sub { my @out = sort { ($a)[0] <=> ($b)[0] } @in },

	map => sub { my @out = sort {
			(map {$_}$a)[0] <=> (map {$_}$b)[0] } @in },

	temp => sub { my @out = sort {
			my( $l, $r ) = map {$_} $a, $b; $l <=> $r } @in },

} ) ;


