in reply to bareword error

The match operator expects its pattern to be surrounded by delimeters, usually m// (ie your pattern needs to be between the slashes). Another problem you've got, is that if the match is not bound to an expression, it will match against $_. You should use =~ to bind the match to an expression.

So, you need to change your if to something like

if ($FORM {'comments'} =~ m/http|html|HTML|A HREF|a href/i )

Replies are listed 'Best First'.
Re^2: bareword error
by ikegami (Patriarch) on Mar 13, 2008 at 23:34 UTC
    and since the i modifier is being used,
    if ($FORM {'comments'}  =~ m/http|html|HTML|A HREF|a href/i )
    can be written as
    if ($FORM {'comments'}  =~ m/http|html|a href/i )

    Note to self: Put two spaces between a and href when using batmanor's form.

      Even further refined:
      if ($FORM {'comments'} =~ m/http|html|a\s+href/i )
      ..as any number of, but more than one, whitespace characters are valid between a and href.

        Now what about <a id="foo" href="...">...

        I would have mentioned \s+ if that's all that was needed.

Re^2: bareword error
by Anonymous Monk on Mar 14, 2008 at 18:38 UTC
    Thanks FunkyMonk,ikegami and Bloodrage for your help. The script is working properly now. Batmanor