in reply to CGI "uninitialized value" question

That bit of code worked for me under Perl 5.6.1 with an older version of the CGI library. However when I ran it under 5.8 with new CGI library, I get the warnings messages. It turns out that you need to define the 'action' for the form to get rid of the error message. Could be a bug in the new version of CGI module, but then again you should really define the action to be taken when submitting the form.

#!/usr/bin/perl -w use strict; use CGI qw/:standard/; print header(); print start_html("This is a test"); print start_form(-action=>"/cgi-bin/test.pl", -method=>"GET"); print end_form();

Replies are listed 'Best First'.
Re: Re: CGI "uninitialized value" question
by thor (Priest) on Dec 09, 2003 at 05:23 UTC
    I would agree that providing an action would be a reasonable fix, except that the documentation says that it provides a reasonable default. I consider this a bug unless there's compeling evidence to the contrary...

    thor

      Well, I guess the documentation has to define what is a reasonable default. From what I saw in the OP, he you got action="/test.pl" as a default, which would not work if the script was stored under "/cgi-bin".

        Not necessarily true - there could be URL munging defined in the conf file, or a mod_perl handler doing some magic.

        rdfield