use List::Util qw(first); first { $_ eq $needle } @list and say "Found!"; [download]
In reply to Re: check if an element exists in array by Tux in thread check if an element exists in array by Anonymous Monk