Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re^4: CGI Post query

by ant (Scribe)
on Jul 06, 2006 at 08:38 UTC ( [id://559513]=note: print w/replies, xml ) Need Help??


in reply to Re^3: CGI Post query
in thread CGI Post query

Hi
You asked why place the form into a hash?
The Perl program uses 6 Perl Modules, collects information from about 60 fields and then makes calls to the other modules to enter and retrieve information from databases, check data constraints, etc. Presently the code calls one param at a time and then passes upto a dozen scalar variables to the various other procedures in different modules.
There are no checkboxes or radio buttons, and currently there are no plans for any files to be uploaded, and this probally won't change in the future.
It just seemed easier to load the form into a hash and then pass the reference of the hash around all the different modules to access all the various parts of the form, rather than have having vast amount of scalar variables declared all over the different modules .
But perhaps I'm wrong, it won't be the first time ;-)
Any more thoughts on this would be great.
Ant

Replies are listed 'Best First'.
Re^5: CGI Post query
by gellyfish (Monsignor) on Jul 06, 2006 at 08:51 UTC

    If you are passing the values of the parameters around in your program you might want to consider using the OO interface to CGI and pass the CGI object around instead and use $cgi->param() in the subroutines. This has the side benefit that if you find that you require more parameters in a subroutine you won't need to change the arguments.

    /J\

Log In?
Username:
Password:

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

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

    No recent polls found