>perl -wMstrict -le "use List::AllUtils qw(lastval); my @call_names = ( 'test AB 25', 'test BC 29', 'test AC 25', 'test AA 30', 'test AA 31', 'test AA 25', 'test AA 20', ); my $last_25 = lastval { m{(\d+)}xms and $1 == 25 } @call_names; print qq{'$last_25'}; " 'test AA 25'