use List::Util qw(reduce); $longest = reduce { length $a > length $b ? $a : $b } @array;