I've a survey form that I'm putting together, with multiple pages and some optional pages that the user would encounter depending on their responces to the prior pages. I know the how of how I'll be doing this, i.e. setting hidden value fields to track what page somebody is on and so on. My problem is that I, in my newbieness, have not the foggiest idea as to how to structure my solution. Does the bunch of code that generates each page sit in its own subroutine? Or should each page link to a new script, one that just generates the html for that page? Or am I way out of the park, and should there not even be subroutines?

My question to my fellow monks is this, "Given the things that need to be done (taking in form input, seeing which page the user is on, outputting pages) how would you folks put this/these script(s) together?" Please forgive the newbieness of the question, but it hit me that I had no idea how real programmers (i.e. those who are not me ^_^) go about putting their solutions into a bundle, and really wish I did. I can't wait to hear your thoughts on the issue, thank you in advance for your time ~Adam

In reply to How to organize one's code by Adam Kensai

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.