NodeReaper has asked for the wisdom of the Perl Monks concerning the following question:

Replies are listed 'Best First'.
Re: Expression searching via Form Input
by geektron (Curate) on Apr 13, 2001 at 03:50 UTC
    that's because the regex fails when no "@" is encountered.

    and this looks suspiciously like code that's not using CGI.pm for arg parsing. i highly suggest you investigate the module, and use it.

    update: i stand corrected. thanks, damian1301.

      Actually, since it is an email address, there will most likely be an @ sign. But, since this person does not backslash it, it is considered an array and the regex engine will bitch. This happened to me today because I was trying to retrieve the $NORM value. Since "$NORM" has a dollar sign in it, the regex engine thought it was searching for what was in the variable $NORM and complained that there was no such variable.

      So, whenever you have a regex, always search for @, $, and % signs to make sure they are blackslashed. Also, if you are trying to match HTML, make sure you backslash then end tags (eg. <\/HTml>) so that the match won't stop.

      But really, if you were using CGI, strict, and -w, then this error should have been caught and never questioned.

      Almost a Perl hacker.
      Dave AKA damian

      I encourage you to email me

        BTW, the % character is never interpolated in a regular expression.

                - tye (but my friends call me "Tye")