Think about Loose Coupling | |
PerlMonks |
Re: CGI lib questionby legato (Monk) |
on Feb 02, 2005 at 19:29 UTC ( [id://427387]=note: print w/replies, xml ) | Need Help?? |
Firstly, I highly suggest CGI::Simple -- it should be a drop-in replacement for CGI, and therefore relatively painless. Second, read the docs for the above (depending on which you decide to use). One can modify parameters through the param function in CGI::Simple, for example. I would try to refrain from modifying %ENV directly. Also, the %ENV represents the environment for your script -- if you do change it (even if it is through use of param()), as soon as your script ends those changes will be lost. The two main ways to pass data around between CGI scripts are sessions and parameters. Parameters are relatively easy -- especially by making use of the HTML hidden input type: However, you will have to be sure that these parameters will be passed by the browser -- which means every link is a form submission. Sessions can be implemented a number of ways. The easiest (also the most prone to problems) is to simply set cookies for the values you need to pass around. One can replace or combine this method with file- or database-driven session management, if need be. I highly suggest looking at Ovid's CGI course, which covers such things and points to many useful resources. Anima Legato
In Section
Seekers of Perl Wisdom
|
|