in reply to Re^2: 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.
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.
|
|---|