I have an array with values 33, 32, 8, 100.
How can I find the maximum and minimum value in this array?
Do I need to include any special libraries?<
For numbers:
my ($min,$max) = (sort {$a <=> $b} @array)[0,-1];
For strings:
my ($min,$max) = (sort {$a cmp $b} @array)[0,-1];