|Pathologically Eclectic Rubbish Lister|
Interactive Form Creation/Maintenanceby Sherlock (Deacon)
|on May 09, 2001 at 20:14 UTC||Need Help??|
Sherlock has asked for the
wisdom of the Perl Monks concerning the following question:
Hello all, I've been working on a scheduling system for a client of mine which I will quickly describe: My client will be able to log in to an editor (that's the form this post refers to) and be able to add, delete, or edit appointments. These appointments are stored in an XML file. When one of my client's users comes to the site, they can view a page that dynamically builds a schedule based upon the appointments in the XML file. The part I'm questioning is the editing form.
This will basically be an interactive form. By that, I mean that my client will get this form to appear, then he'll be able to press buttons and type content into the form and then get the same form back but with different information displayed. (If you'd like to see the portion of it I have working now, go here. The username and password are Administrator/schedBuilder - they are case sensitive.)
I've been using HTML::Template for some of the script, such as the login screen, but, as this will be an "interactive" form, I don't see how I can still use HTML::Template. I really need a way to push data into form components and I don't think that can be done with HTML::Template. Perhaps there's a way to use that module that I'm overlooking.
In order to get the functionality that I'm looking for, I've written two different pieces of code that perform the same task, just in different ways. The first one uses various methods from CGI.pm:
The second piece of code I've written uses block printing and looks like this:
As far as I can tell, these two bits of code work identically. The only question I have is which one is going to be easier to maintain. Personally, I'm able to read the second bit easier so I would feel that this would be the easiest to maintain, but so often, I hear monks exclaim "USE CGI.pm!" Is there something I'm missing that would make the first portion of code easier to maintain later?
Skepticism is the source of knowledge as much as knowledge is the source of skepticism.