CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
Search Posts SEARCH
Who's Online WHO'S
Log in LOG

Home: Perl Programming Help: Beginner:
The State of a form



Feb 23, 2001, 2:00 PM

Post #1 of 3 (420 views)
The State of a form Can't Post

I was playing w/ and using it's feature to save the state of a form to a file. I loose info somewhere and could not figure out where so I got the bright Idea of doing basically what the was already doing to see if I can prevent that leak.

I save a list of all my name/value pairs to a file much like this
toy=buzz lightyear

Okay so now that it's sitting pretty in a nice file, I want to call that file and place each name/value pair in variables. Each variable being identical to the name and it's contenst being the value.

Does anyone have a slick code piece to perform this seemingly simple task? If so, could I possably get an explenation of the said code snip?



Feb 24, 2001, 6:01 AM

Post #2 of 3 (414 views)
Re: The State of a form [In reply to] Can't Post

Don't do that. Don't make individual variables for each one. Use a the CGI object. Your method will break with checkboxes, multiple-select, or any other field that is duplicated.

use CGI; 
open INPUT, "query-file";
my $quer = CGI->new(\*INPUT);
close INPUT;

Jeff "japhy" Pinyan -- accomplished hacker, teacher, lecturer, and author


Feb 24, 2001, 7:18 AM

Post #3 of 3 (412 views)
Re: The State of a form [In reply to] Can't Post

so doing it this way would allow me to refer to the object any time I need it right?


$something = $query->param('name');
do something with $something

Is that what your saying? So if that's right then I can pull the info as I need it and not all at one time right? Or am I missing the point all together?

as for my original problem I figured out what it was. I knew the leak was not the and somewhere in my code and it was. <g>



Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives