http://qs321.pair.com?node_id=675549


in reply to OR sequence

One way of doing it is

if (grep { /http|html|a href/i } $FORM{'Comments'}, $FORM{'addr'}, $FO +RM{'name'}) { ... }
In Perl 5.10 that can be written as
if ([ $FORM{'Comments'}, $FORM{'addr'}, $FORM{'name'} ] ~~ /http|html| +a href/i) { ... }
which is pretty close to how you tried to write it. The latter is also slightly more efficient for large lists, as it stop to look in the list as soon as it finds a match, in contrast to grep which searches the whole list.

lodin