I appologize for my ignorance, but I'm still new at this!
If you are asking for help, you are not ignorant. You appear to be attempting to write a multi-form CGI application based upon a bunch of predetermined templates.
The difference between you and the people who are
really good at this is that they know what
not to do!
The parsing of HTTP query strings in your own code is considered a no-no in professional circles since it is handled by the CGI module, which comes as standard in your Perl installation. Look up the details for the
param function and you can do away with your
read_query_string() function altogether.
While it is difficult to give concrete advice on the architecture of your whole application, I can heartily recommend
CGI::Application as being an excellent way to generalise its different stages into functions.
You are also well-advised to consider some kind of templating solution for organising the HTML pages you have prepared. I have had a great deal of success with
Template Toolkit but a number of other solutions exist.
Your script shows all three forms at the same time because the first two lines tell it to do so - you need some stuff in between them to stop this happening ;) You need to do a little bit of reading through some examples, I reckon, but what you are doing - trying to get something working by trial and error - is
definitely a step in the right direction and you have found the right place to ask more specific questions.
MB
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.