TedYoung has asked for the wisdom of the Perl Monks concerning the following question:
Good Day,
I was reading Z-Rated Code and Reinventing the Wheel which made reference to a few alternatives to the CGI module. One in particular was CGI::Simple. The CGI::Simple perldocs say the following with regards to the import_names method:
This method was silly, non OO and has been deleted.
Now, CGI::Simple's goal is to provide an OO interface, so naturally this method doesn't make much sense here.
But the statement that it was silly made me think a bit. What do other's think about using import_names?
I write web apps for a living. For most of my apps, I break out the controller into packages of event handlers (each package representing related functionality). import_names allows me to import all of my params into a namespace (I normally use in::) so I don't have to pass an object or hash between packages. It even supports multi-values as arrays (i.e. @in::foo).
I remember that PHP had a similar feature that was ultimately frowned upon because of security concerns, but I thought those were moot here because we specify a namespace, into which to dump the data.
Now, I am not debating the advantages of an OO framework by any means. I am just curious if there are any major pitfals with import_names that I am not seeing.
Thanks,
Ted Young
($$<<$$=>$$<=>$$<=$$>>$$) always returns 1. :-)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: $CGI->import_names
by derby (Abbot) on Apr 17, 2006 at 16:16 UTC | |
|
Re: $CGI->import_names
by doc_faustroll (Scribe) on Apr 18, 2006 at 04:47 UTC |