CGI.pm - strange difference between CGI.pm version 2.81 and 2.36

From: Joe Floeder (jmfloeder_at_yahoo.com)
Date: 04/29/04


Date: 29 Apr 2004 10:23:16 -0700

or this could be a difference somewhere else in perl version 5.8
versus 5.4? The question is where am I getting this syntax error? --
the CGI module or perl itself? And why is the newer versions of
perl/CGI.pm not throwing the error.

When using CGI.pm 2.81 in perl 5.8 we could call CGI.pm functions
using a reference to a data structure like so

$row->[4](-name=>$row->[2],-values=>$row->[5],-default=>none)

without receiving a syntax error. We were storing the names of form
input elements in that column of an array or arrays (i.e "textfield",
"radio_group", etc.)

Yet the same script run under CGI 2.36 in perl 5.4 would throw a
syntax error.

We ended up having to "hard code" the function names like so

textfield(-name=>$row->[2],-values=>$row->[5],-default=>none)

and now the script works in both releases of CGI.pm and perl. What is
the newer versions doing that the older versions can not?

Thanks.



Relevant Pages

  • Re: Help with a stragegy for diagnosis
    ... I have a Perl CGI that has work for years. ... first failure and before the second. ... A strategy would be to write tests for the script until you get the same ...
    (comp.lang.perl.moderated)
  • FAQ 9.1 What is the correct form of response from a CGI script?
    ... This message is one of several periodic postings to comp.lang.perl.misc ... from the documentation provided with Perl. ... What is the correct form of response from a CGI script? ... The Common Gateway Interface (CGI) specifies a software interface ...
    (comp.lang.perl.misc)
  • FAQ 9.1 What is the correct form of response from a CGI script?
    ... This message is one of several periodic postings to comp.lang.perl.misc ... from the documentation provided with Perl. ... What is the correct form of response from a CGI script? ... The Common Gateway Interface (CGI) specifies a software interface ...
    (comp.lang.perl.misc)
  • Re: Advice about cgi programming
    ... experience with other scripting languages. ... This might not be the most appropriate group, but since Perl is ... input string to this script in the background and return the result. ... Perl is an excellent choice for writing CGI programs. ...
    (comp.lang.perl.misc)
  • FAQ 9.1 What is the correct form of response from a CGI script?
    ... comes with the standard Perl distribution. ... What is the correct form of response from a CGI script? ... The Common Gateway Interface (CGI) specifies a software interface ... The similarity between CGI response headers (defined in the CGI ...
    (comp.lang.perl.misc)