Skip navigation.
Home
Your source for Perl tips, howto's, faq and tutorials
( categories: )

There are no perl built-in functions to get the numerical minimum or maximum of a set of values, but those functions are defined in the standard module List::Util.

Please notice that, by default, List::Util does not export any function, so you have to explicitly declare them like in the following example:

use List::Util qw(min max);
 
@list = (10, 20, 35, 4, -2);
 
print 'The minimum value is: ', min(@list);