Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > Re: Making CGI.pm forget

Reply
Thread Tools

Re: Making CGI.pm forget

 
 
Wolf Behrenhoff
Guest
Posts: n/a
 
      06-19-2012
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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Making CGI.pm forget ccc31807 Perl Misc 0 07-11-2012 08:37 PM
Re: Making CGI.pm forget J. Strübig Perl Misc 0 06-20-2012 09:25 AM
Re: Making CGI.pm forget Xho Jingleheimerschmidt Perl Misc 0 06-20-2012 04:31 AM
Don't Forget Jtyc MCSE 0 08-13-2003 08:37 PM
Re: Make text boxes "forget" values Emil Kvarnhammar ASP .Net 0 07-16-2003 07:53 AM



Advertisments