use List::Util qw( minima maxstr ); my $val = maxstr minima { length } @list;