use List::Util qw(first max maxstr min minstr reduce shuffle sum); first BLOCK LIST ... "first" returns the first element where the result from BLOCK is a true value.