summaryrefslogtreecommitdiff
path: root/Bugs/minmax
blob: 4251f815879aa7aea6c1e34dc69e412aee7c1186 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
#!./perl

sub minmax {
  eval '@_ = sort { $a '.shift().' $b } @_';
  (shift, pop(@_));  
}

($x, $y) = &minmax('<=>', 2, 4, 1, 0, 3);
print "x = $x, y = $y\n";
($x, $y) = &minmax('cmp', "foo", "bar", "zot", "xyzzy");
print "x = $x, y = $y\n";