min#
Return the numerically smallest value in the list.
תקציר#
my $lo = min @values;
my $lo = min 3, 9, 12; # 3
מה מוחזר#
A single number. If every argument is an integer the result is returned as an integer; otherwise it is returned as a float. An empty list yields undef.
דוגמאות#
my $n = min 1..10; # 1
my $n = min @bar, @baz; # smallest across concatenated lists
my $n = min(); # undef
מקרי קצה#
Empty list returns
undef.Strings are compared numerically (use
minstrfor lexical order).
הבדלים מן ה-upstream#
Fully compatible with upstream.
ראו גם#
max- the numerical maximum counterpart.minstr- string-wise minimum (ltsemantics).reduce- custom minima (e.g. by a key function).