This is a live mirror of the Perl 5 development currently hosted at
https://github.com/perl/perl5
https://perl5.git.perl.org
/
perl5.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
blame
|
history
|
raw
|
HEAD
perl 5.0 alpha 2
[perl5.git]
/
Bugs
/
minmax
1
#!./perl
2
3
sub minmax {
4
eval '@_ = sort { $a '.shift().' $b } @_';
5
(shift, pop(@_));
6
}
7
8
($x, $y) = &minmax('<=>', 2, 4, 1, 0, 3);
9
print "x = $x, y = $y\n";
10
($x, $y) = &minmax('cmp', "foo", "bar", "zot", "xyzzy");
11
print "x = $x, y = $y\n";
12