Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re^2: Web form to alter files is writing to file before submit button is pressed.

by Lady_Aleena (Deacon)
on Mar 11, 2012 at 19:24 UTC ( #958999=note: print w/ replies, xml ) Need Help??


in reply to Re: Web form to alter files is writing to file before submit button is pressed.
in thread Web form to alter files is writing to file before submit button is pressed.

aaron, so this checks all of the parameters I set, and if any of them are defined, then it will do stuff with the submitted form data. There may be one small problem with having to check all of those parameters which is some of my files will have tens of thousands of parameters to check. I am not overly worried about speed, but would that slow things down a little?

Have a cookie and a very nice day!
Lady Aleena


Comment on Re^2: Web form to alter files is writing to file before submit button is pressed.
Re^3: Web form to alter files is writing to file before submit button is pressed.
by aaron_baugher (Deacon) on Mar 12, 2012 at 01:09 UTC

    That's not quite what it does. $cgi->param returns a list of the names of all the form fields submitted by the browser. So if any are submitted, it will return true, regardless of their values. Only when the URI is requested without any POST data -- as when the page is first loaded, typically -- will it return nothing, giving a false status to the if statement. So it's not really "checking all the parameters." To the extent that it loads them into some sort of structure, I'm fairly sure that was already done when you created the CGI object, so there's not much cost here.

    On your last question: If you have forms with that many fields, I think you'll run into bottlenecks at the browser or the web server -- with the maximum POST data size, for instance -- long before counting the items in a large array slows down your Perl script. With a form that large, I'd be more concerned about usability and maintainability than with speed.

    Aaron B.
    My Woefully Neglected Blog, where I occasionally mention Perl.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (5)
As of 2014-12-20 05:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (95 votes), past polls