Re: arrange form data in same order as on form
From: A. Sinan Unur (asu1_at_c-o-r-n-e-l-l.edu)
Date: 11/14/03
- Next message: A. Sinan Unur: "Re: arrange form data in same order as on form"
- Previous message: Gunnar Hjalmarsson: "Re: arrange form data in same order as on form"
- In reply to: Gunnar Hjalmarsson: "Re: arrange form data in same order as on form"
- Next in thread: Gunnar Hjalmarsson: "Re: arrange form data in same order as on form"
- Reply: Gunnar Hjalmarsson: "Re: arrange form data in same order as on form"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 14 Nov 2003 02:05:52 GMT
Gunnar Hjalmarsson <noreply@gunnar.cc> wrote in news:bp1c15$1in3ke$1@ID-
184292.news.uni-berlin.de:
> Eric Schwartz wrote:
>> Gunnar Hjalmarsson <noreply@gunnar.cc> writes:
>>>>>> bbxrider wrote:
>>>>>>
>>>>>>> read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
>>>
>>> Still don't understand what it is that makes the above code
>>> "buggy".
>>
>> The read() may not read $ENV{'CONTENT_LENGTH'} bytes into $buffer,
>> and there's no attempt made to detect or handle this event.
>
> Some kind of exception handling is most often useful, but the lack of
> it isn't exactly a _bug_, is it?
OK, you can call it something else then. Let's assume you don't care about
that. There is still the fact that
>>>>>>> @pairs = split(/&/, $buffer);
will miss pairs separated by a semicolon. In addition, parameter names are
not unescaped. What happens when the query string given is
?param=;
> I very much dislike the aggressive way in which some people here
> advocate the use of CGI, and the lack of faith that is shown in
> people's own judge.
As Eric Roode pointed out, the same exact code has been posted here
numerous times (e.g. http://groups.google.com/groups?hl=en&lr=&ie=UTF-8
&oe=UTF-8&safe=off&selm=4096148f.0310161157.9400327%40posting.google.com)
so I assumed the OP was not relying on his own judgement, but using someone
else's code. In that case, he is better off using CGI.pm.
Sinan.
-- A. Sinan Unur asu1@c-o-r-n-e-l-l.edu Remove dashes for address Spam bait: mailto:uce@ftc.gov
- Next message: A. Sinan Unur: "Re: arrange form data in same order as on form"
- Previous message: Gunnar Hjalmarsson: "Re: arrange form data in same order as on form"
- In reply to: Gunnar Hjalmarsson: "Re: arrange form data in same order as on form"
- Next in thread: Gunnar Hjalmarsson: "Re: arrange form data in same order as on form"
- Reply: Gunnar Hjalmarsson: "Re: arrange form data in same order as on form"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|