in reply to OR sequence
|| does not form a list of operands to pass to another operator. There's isn't such an operator in Perl5 (but I bet there is in Perl6). Of its two operands, it returns the first one that is true.
What you want is
if ( $FORM{'Comments'} =~ m/http|html|a href/i || $FORM{'addr'} =~ m/http|html|a href/i || $FORM{'name'} =~ m/http|html|a href/i )
You can remove the redundancy with a loop
for (@FORM{qw( Comments addr name )}) { if (m/http|html|a href/i) { html_message(); last; } )
Is there a reason you didn't apply my suggestion to change
/http|html|HTML|A HREF|a href/i
to the simpler and equivalent
/http|html|a href/i
That's what the "i" does.
|
|---|