# Do this using GREP my @people = ('Jacob Smith', 'Michael Brown', 'Joshua Smith', 'Matthew Cope'); @smiths = grep(/smith/i, @people); #### No! my $first = (grep /smith/i, @people)[0]; But inefficient, because it will grep more than necessary. #### my ( $first) = grep ...; #### my @l = qw( foo bar baz); ( my ( $first) = grep /ba/ => @l ) > 1 and warn "not unique\n"; print "first: $first\n";