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
    Changing operator to == worked! Thank you all so much. Is there anyone out there that could review these scripts and offer suggestions? Paid, of course.

      Check out http://jobs.perl.org, or one of the many freelance sites if you're looking to pay someone to do a code review. Here you get small amounts of professional quality help in return for asking interesting questions. ;)


      Dave

Re^2: CGI Script sub
by citabriabob (Novice) on Nov 08, 2015 at 23:16 UTC
    Missed your note on line 5; do you mean a backslash before the @ character? Sorry to be so obtuse, but these string manipulations are difficult for me to see.
      ... a backslash before the [literal] @ character?

      Taking the liberty of replying for fellow monk davido: Yes.


      Give a man a fish:  <%-{-{-{-<