I am writing a program to load and display multiple forms and to support cgi->save(FILE)'ing and loading form data.
Each form is written in HTML and stored in a text file. The main cgi loads the text file and sticks it in an HTML template and saves data to a filehandle on submit. To view and edit the form data, I have a second CGI which is called with a GET filename parameter.
However, when I do
$query = new CGI(FILEHANDLE)
and then load and display the form, the saved data doesn't make its presence known. I'm assuming that this is because my form HTML doesn't get associated with the $query since it is just text.
1 - Is this not working for the reason I think it's not working?
2 - If I construct the form using CGI $query->startform... will the saved state restore properly?
3 - if I do #2 how could I (or is there a module) to convert HTML into perl?
4 - if I do #3, how will I tell perl to load the form file and then process the commands in it (since I still want to have the option of loading many different forms)?
I'm sorry if this sounds complicated, I'm really tired and having trouble thinking straight. Any advice, direct or indirect is greatly appreciated.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.