in reply to CGI Script sub
One reason this code can't work is line 13:
} elsif (processCard($data{'51CardNum'}) = 2) {
...because that attempts to assign 2 to an lvalue sub named processCard, but that subroutine is not defined as an lvalue sub. I'm sure you intended to use the relational == operator:
} elsif (processCard($data{'51CardNum'}) == 2) {
Also, on line 5:
if (!($data{'26Email'} =~ /.+@.+\..+/)) {
It is by sheer luck that Perl is treating @. as the literal character @, and the metacharacter .. If what came after @ were, instead, valid "identifier" characters, it would trigger variable interpolation. To be safe, precede the @ inside of regular expressions (update: with a \ escape) unless you intend for it to be treated as an array sigil.
Dave
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: CGI Script sub
by citabriabob (Novice) on Nov 08, 2015 at 22:52 UTC | |
by davido (Cardinal) on Nov 08, 2015 at 22:54 UTC | |
|
Re^2: CGI Script sub
by citabriabob (Novice) on Nov 08, 2015 at 23:16 UTC | |
by AnomalousMonk (Archbishop) on Nov 08, 2015 at 23:39 UTC |