Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: CGI lib question

by legato (Monk)
on Feb 02, 2005 at 19:29 UTC ( [id://427387]=note: print w/replies, xml ) Need Help??


in reply to CGI lib question

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:

<input type='hidden' name='my_hidden_var' value='some data here' />
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
.oO all things connect through the motion of the mind

Replies are listed 'Best First'.
Re^2: CGI lib question
by hok_si_la (Curate) on Feb 02, 2005 at 20:06 UTC
    Legato,

    Thanks for the info. I will look into CGI::Simple, and Ovid's CGI course. When looking for more info on CGI::simple vs CGI.pm I found this site for anybody who's interested.
    http://search.cpan.org/src/JFREEMAN/Cgi-Simple-0.077/cgi-simple_vs_cgi-pm.html

    It also seems to have some very useful methods.
    Thanks again,
    hok_si_la
      Here is a much better link that compairs the two:

      http://www.enstimac.fr/Perl/perl5.8.5/site_perl/5.8.5/CGI/Simple.html#differences_from_cgi_pm

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://427387]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (6)
As of 2024-04-23 09:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found