On Fri, Sep 30, 2011 at 10:19, Rajeev Prasad <rp.ne...@yahoo.com> wrote:
> by the way, question was: how do you collect the value of a multiselect, > without using CGI module. Octavian did answer that question; I'll do it again: you collect the value of a multiselect by getting and parsing the value of the query string in the HTTP request and/or by getting and parsing the value of the HTTP request body, depending on whether the HTTP request is a GET or a POST (and other refinements, like whether you want to support query string paramaters given in a POST request). The other thing that people are trying to communicate to you is that *doing* that, and doing it properly, and doing it properly in all the odd circumstances that usually don't happen but are allowed by the HTTP spec, is a HARD problem. In addition to being a HARD problem -- and really, it's the worst kind of hard problem, that kind that's easy to get *almost* right, so it won't fail until much later under the absolute worst circumstances -- it's a solved problem. There are multiple modules on CPAN that do this -- CGI and CGI::Simple have both been mentioned, IIRC -- so, really, there's no need for you to do this. One of those will work and it won't be any bigger than something you write yourself. Now, after that warning and explanation, if you still want to try -- and hey, some times resolving solved problems is good practice for figuring out how to solve unsolved problems, right? -- then the first thing to do would be to get and read the HTTP RFC. (Google will help with that.) Then, get the source for one of those CPAN modules, and read it. That will show you a fully working, debugged example of how to do what you're trying to do, with tests -- so you can modify the code, try to improve it, and see if it still works in the same way. And after all that, if you come up with a way to do it better, you'll be perfectly positioned to contribute it back to the maintainers of the module, and you'll make *everybody's* life better. chrs, john. -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/