perl 5.0 alpha 2
[p5sagit/p5-mst-13.2.git] / Bugs / minmax
CommitLineData
79072805 1#!./perl
2
3sub minmax {
4 eval '@_ = sort { $a '.shift().' $b } @_';
5 (shift, pop(@_));
6}
7
8($x, $y) = &minmax('<=>', 2, 4, 1, 0, 3);
9print "x = $x, y = $y\n";
10($x, $y) = &minmax('cmp', "foo", "bar", "zot", "xyzzy");
11print "x = $x, y = $y\n";
12