Am 19.06.2012 17:51, schrieb Bernie Cosell:
> One aspect of CGI.pm that I've never liked is that it tries to 'remember'
> form variables from one page to the next --- and worse makes it hard to
> change a value, preferring to ignore your attempts to change the value and
> keep the old one unless you go to some bother. I *hate* this behavior and,
> basically, always want to build my forms exactly as I want them [and,
> indeed, generally prefer sessions to provide continuity from one form to
> the next rather than larding up each form].
Hm, I don't do much CGI programming (almost none at all), but the few
times I did it I liked this behaviour... I guess most people are using
template systems anyway and just use CGI to read in data, not to write
pages.
> What I did, years ago, was this:
>
> $cgi = new CGI ;
> new CGI("") ; # MAke sure the default CGI object doesn't know anything
>
> and it seemed to work: my intent wsa to make the 'default' CGI object be
> truly empty, but I could still get the incoming form data via
> $cgi->{whatever}. We're running perl 5.8.8 and have $CGI::VERSION='3.15';
>
> I was chasing an annoying problem with a web page I'd generated and I
> discovered the problem. The code is:
>
> print h1("Program access for $progdesc") ;
> print "<form>\n" ;
> print hidden(prog => $prog), "\n", hidden(page => 'setacl'), "\n" ;
Considering the documentation:
DELETING ALL PARAMETERS:
$query->delete_all();
This clears the CGI object completely. It might be useful to
ensure that all the defaults are taken when you create a
fill-out form.
Use Delete_all() instead if you are using the function call
interface.
It appears that you are using the function call interface, so have you
tried Delete_all()?
- Wolf
|