4 require Config; import Config;
5 if ($Config{extensions} !~ /\bList\/Util\b/) {
6 print "1..0 # Skip: List::Util was not built\n";
11 use List::Util qw(max);
15 print "not " unless defined &max;
18 print "not " unless max(1) == 1;
21 print "not " unless max(1,2) == 2;
24 print "not " unless max(2,1) == 2;
27 my @a = map { rand() } 1 .. 20;
28 my @b = sort { $a <=> $b } @a;
29 print "not " unless max(@a) == $b[-1];