Document Home


Previous- Starting a Structure


Previous- Coordinating Output with Stacked Handlers



Restructuring the Entry Process Using the Apache API


This is the second time I have written this particular section, or at least the beginning of it. Since I am my own quality control for this stuff, the progression I follow is to work through a given chunk, hopefully sized at a level at which it is digestible as a chunk, then describe what is happening on paper (I use the back sides of printer test pages, print banners, messed-up jobs, etc. I'm very enviro in that sense. Doesn't have anything to do with the rumor that I can't stay within the lines of a legal pad. That's just something the lawyers say about me. Of course, they're lawyers cause they can stay within the lines of a legal pad, but that's another matter.) My second draft, if you will, occurs when I start typing and create the html docs ... that's when I look for awkward phrasings and the like. After that I generally print the page, read it, make any requisite corrections, and update the site. Generally, I try to have two of these sequences going on at once, which helps to infuse the former section with perspective on what is to follow, but sometimes it just doesn't work out that way.


Anyway, in between the previous section and this one I ran into three or four weeks worth of involvement with other things, and only in the past few days have gotten back onto this. I finished the implementation of what is included here, and tacked the description onto about a page I had written previously. When it came time to type that in I decided I really didn't like that first part all that well. Hence ... this. (You may wonder where this little discussion is going. I just felt talkative.)


One point I made in the discussion I tossed out that I do want to keep involves a warning not to assume too much. There are strong similarities between many methods in the CGI module and those in the Apache module that provides methods to interact with the Apache request object in mod_perl. That's only natural. Form does tend to follow function, and even more so when there are external influences like stylistic conventions, informal that they may be in the case of perl. You will save yourself some frustration, however, if you do not allow that to blind you to the fact that the modules and methods are different, have varying degrees of difference in the syntax by which they are called, and have their own idiosyncracies attendant to the way they operate internally. For example, while it is possible to print multiple lines of html back to the browser with one call to the Apache request object's print() method, and in fact you can see that I do so in the footer() subroutine, that method is far more tempermental in such contexts than is the print() method associated with a CGI object. Just because you think something should work doesn't mean that it will. Keep that in mind and it will generally be easier to track down problems.


Be that as it may, it's time to jump into this. I am going to split this into two sections, the first of which will discuss how the menu structure work works and how state is maintained on a global level, and the second will involve dropping the data entry loop into that structure.



The Menu and Global State Management
Dropping in the Entry Process