You might also want to read up on the CGI::Application module, available from CPAN. Instead of each page corresponding to a section of an ever-growing (and harder
to maintain) if-then-else block, you create a subroutine
for each page (called a 'run mode'). All the subroutines
go into a module, and your cgi-script reduces to about 3 lines of code: load module, create instance, run application!
If your starting a new project from scratch, it's definitely worth checking out. It could save you lots of time and energy down the road.
| [reply] |
Indeed, this is precisely what CGI::Application is made for. As a working example, here's a fairly simple C::A application.
__________
Systems development is like banging your head against a wall...
It's usually very painful, but if you're persistent, you'll get through it.
| [reply] |
The CGI would key off what set of information to display based on either a parameter (retrieved using the CGI param method) or by using extra path information after the name of the CGI itself (retrieved with path_info). It'd then use that key to decide what to return.
That's pretty much it; not much more complicated than what you've already described.
Update: Ooh, yeah seconding the CGI::Application recommendation below. It provides a ready-made framework that does just this type of thing for you out of the box.
| [reply] [d/l] [select] |
A simple bare-bones but very flexible option would be CGI::Prototype. While the documentation with the module itself is spare, Randal has written a few articles on it (1, 2, 3) as well as a freely available
slideshow. | [reply] |
| [reply] |
I think the OP is asking about separate web pages handled by a single script, as opposed to "paging" through a result set.
| [reply] |
That works, thank you all for your timely responses :) | [reply] |