in reply to find text in string

You may want the index function. It returns -1 if there is no exact match.

for (@array) { do {something($_)} if -1 != index( $_, 'bar'); }

For more complicated matching, you probably want a regex match,

# . . . if m/foo|bar|baz/;

After Compline,
Zaxo