my $list = "foo:bar:baz"; my $wanted = "bar"; if (grep {$_ eq $wanted) split ":", $list) { print "found!\n"; }