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