N
Nick Wedd
I am writing a cgi script, and I want to get at the values which were
passed to it as arguments. I finally found a way to do this, at
http://www.perldoc.com/perl5.8.0/lib/CGI.html. You say
use CGI qw/:standard/;
my $edges = param('foo');
and it works.
But before I found this web page, I tried "Learning Perl", which
recommends (page 187)
use CGI qwstandard);
my $edges = param{"foo"};
This does not work. Instead it sets $edges to "".
Then I tried "Perl in a Nutshell", which recommends (page 330)
use CGI;
my $edges = $query->param("foo");
This is worse. My script stops at the second of the above lines.
Now I can't believe that these books are actually wrong about something
so basic. Yet what they recommend does not work on my system. Can
anyone explain what is going on here?
Nick
passed to it as arguments. I finally found a way to do this, at
http://www.perldoc.com/perl5.8.0/lib/CGI.html. You say
use CGI qw/:standard/;
my $edges = param('foo');
and it works.
But before I found this web page, I tried "Learning Perl", which
recommends (page 187)
use CGI qwstandard);
my $edges = param{"foo"};
This does not work. Instead it sets $edges to "".
Then I tried "Perl in a Nutshell", which recommends (page 330)
use CGI;
my $edges = $query->param("foo");
This is worse. My script stops at the second of the above lines.
Now I can't believe that these books are actually wrong about something
so basic. Yet what they recommend does not work on my system. Can
anyone explain what is going on here?
Nick