in reply to Re: passing information through hidden fields using CGI.pm
in thread passing information through hidden fields using CGI.pm

Since he's just 'passing through' the values, and CGI.pm parameters are 'sticky', this:
print hidden('hey','you');
can be shortened to this:
print hidden('hey');
In fact, you have to specifically pass an override flag if you want to override the 'sticky' default, so the first example wouldn't even work if you were trying to change the value of the 'hey' parameter.

Update:damian1301 is wrong below. See this:

$ perl -e 'use CGI qw(:standard -debug);print hidden("hey")' hey=you <input type="hidden" name="hey" value="you"> $ perl -e 'use CGI qw(:standard -debug); print hidden("hey","there")' hey=you <input type="hidden" name="hey" value="you"> $ perl -e 'use CGI qw(:standard -debug);print hidden(-override=>1, -name=>"hey",-value=>"there")' hey=you <input type="hidden" name="" value="there">

Replies are listed 'Best First'.
Re: Re: Re: passing information through hidden fields using CGI.pm
by damian1301 (Curate) on Feb 13, 2001 at 02:40 UTC
    Very true, thank you. But  print hidden("hey"); would only pass myscript.pl?hey= which might not always be what you wanted. Especially if you want to maintain state in a HTTP authentication through hidden fields. Mostly, it depends on what your doing to decide what you want to use. Thanks. Later

    Almost a Perl hacker.
    Dave AKA damian

    I encourage you to email me