- or download this
my @list = qw/ frog turtle tadpole /;
my $find = "turtle";
...
if( grep { $_ eq $find } @list ) {
print "Found $find.\n";
}
- or download this
my $found_flag = 0;
foreach my $item ( @list ) {
...
if( $found_flag ) {
print "Found $find.\n";
}
- or download this
use List::Util;
...
if( first { $_ eq $find } @list ) {
print "I found it!\n";
}