PhillipHuang has asked for the wisdom of the Perl Monks concerning the following question:
Yes, the cgi scripts run well and show the expected result, however, I see a lot of warnings at 'error.log':use CGI qw/:standard/; print header, start_html('Simple Script'), h1('Simple Script'), start_form, "What's your name? ",textfield('name'),p, "What's the combination?", checkbox_group(-name=>'words', -values=>['eenie','meenie','minie','moe'], -defaults=>['eenie','moe']),p, "What's your favorite color?", popup_menu(-name=>'color', -values=>['red','green','blue','chartreuse']),p, submit, end_form, hr,"\n"; if (param) { print "Your name is ",em(param('name')),p, "The keywords are: ",em(join(", ",param('words'))),p, "Your favorite color is ",em(param('color')),".\n"; } print end_html;
I used object-oriented style before, and this is my first experience to function-oriented style. I googled for this question and just found the items according to 'object-oriented style'. Would you please help me explain the warning message at log? and how to fix it as function-oriented style? Thanks, PHroot@Sparta:/var/www/cgi-bin# tail -f /var/log/apache2/error.log CGI::param called in list context from /var/www/cgi-bin/test.cgi line +22, this can lead to vulnerabilities. See the warning in "Fetching th +e value or values of a single named parameter" at /usr/local/share/pe +rl/5.18.2/CGI.pm line 404.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: CGI problem: USING THE FUNCTION-ORIENTED INTERFACE
by stevieb (Canon) on Nov 18, 2015 at 16:08 UTC | |
by tye (Sage) on Nov 18, 2015 at 17:49 UTC | |
by leej (Monk) on Nov 19, 2015 at 06:47 UTC | |
by tye (Sage) on Nov 19, 2015 at 11:08 UTC | |
by leej (Monk) on Nov 19, 2015 at 12:04 UTC | |
| |
by PhillipHuang (Beadle) on Nov 19, 2015 at 16:23 UTC | |
by PhillipHuang (Beadle) on Nov 19, 2015 at 01:10 UTC |