I probably should be ashamed to say this, but I tend to use the words script and program interchangably.  However, I think that the word script is appropriate here as you're (chromatic) implying:  Each of my .cgi files have minimal functions (keeping with Unix Philosophy).  Some create a web page for displaying a "form" for the user to fill out and "submit" for "post"ing.  Some read in data from previous scripts (via CGI.pm and HTML forms and some parsing I ripped off from O'Reilly--subparseform.lib) and process the data (e.g., update a mySQL database).  I do have some "require" lines that call upon a couple library (.lib) files that contain common functions.  Maybe these are causing me trouble.

Alright, now we're getting complicated and getting involved too much in fixing my immediate problem, which isn't as important for me as my grasping the concept of "new CGI" (and I guess from what you're telling me, object oriented programming).  Grasping the concept, I believe, will solve the immediate problem and future ones.

You mentioned that if I call new() within the same process, I'll run into trouble.  This seems to be the effect (the trouble, that is) that I'm experiencing.  It also seems to be touching on the subtle conceptual aspect that I was suspecting:  namely, although I may use new() in two separate .cgi files, by passing data from one to the other in this object bundle, as you put it, or $q, as I coded it, am I wiping out the data within $q with another new() in the second script by invoking it before I can parse the data into my string variables?  Boy, that was a long-winded question.  Put simply, if I were to alternate from $q and $x, or if I were to not declare new() until after I parse and save my data into string variables, would that solve my problem?  Okay, another long-winded sentence--it seems unavoidable for me when discussing such a concept and trying to apply it.  I'll stop here and let you and others respond, if you all would be so kind.

Oh, and thanks for all of the postings thus far.  They have been helpful.  I've been playing with the practical suggestions and pondering the conceptual ones.  I think I'm getting closer.  Of course, that may yet to be determined.


In reply to Re: Conceptualizing by Spenser
in thread Conceptualizing by Spenser

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.