Curtis,
Is this why you want my CGI.pm input replacement lib? So you can turn around and
tell me why
CGI.pm is so much superior? As I read through the tutorial here, with every thing
said, the basic
message seemed to be "It doesn't matter who you are or how smart you think you are,
your not
competent to make a replacement for CGI.pm. Just mindlessly follow because it works".
It seemed
that the document continued again and again to explain problems with writing your own,
purposely
avoiding any possible solutions, though in my eyes, the solutions were all too obvious.
I read the entire document in hopes to find anything that I had not taken into
account in hopes
I would find something I could fix. Every problem presented, I have already solved.
There is only
one that I have disregarded because I found it was too uncommon. I at one point did
have code to
attempt to get more from STDIN if all had not come in the first instance, but after 2
1/2 years of
watching, never saw the occurrence once. I expect that I will receive a reasonable
solution to this
one day, and will improve the lib just that much more. Yes, I created a mime parsing
function to
handle the POST method and save files and give them safe non-executable permissions.
Though I did
not cause the lib to gather and parse the get data along with the post data, I had
thought about it,
for a while trying to determine whether I should get them both or not. After much
pondering, I
eventually decided to not. Though considering the topic again, I think I will give
the option.
I did know that CGI.pm gave the option of receiving get and post together upon
uncommenting a
line. Of coarse this is because of my countless peerings into the works of CGI.pm.
You know, I
think CGI.pm was intended to be very difficult to follow. It seems those who wrote
it, didn't want
it to be simple to understand when looking at the code. Mine is very easy to read.
Very well
commented. Anyone who has much experience with perl (along side the comments) should
be able to
fully understand what I'm doing. Why do I want this? Because I don't want people
digging through
the code and wondering to them selves, now where did this come from and where was it
going, but
instead to be analyzing the code and say, oh, this one thing here could be done more
efficiently. I
don't want people to use my code because it just works and they should feel like they
are not
capable of understanding it. I want anyone who' knows perl to be able to give me
feedback on ways
to make it better. I want to have a superior lib for cgi input because 1,000 head are
better than
one.
Now with that said, let me just say, I'm not dis-ing CGI.pm. Its a great lib for
so many
things. It has tons of functionally I'm not attempting to replicate. I just like my
input
formatted in a simple to use data structure. Why use CGI.pm to pull it in, and do a
whole bunch of
things to it that I'm just about do change for my own formatting? I might as well
make a lib that
quickly and efficiently accomplishes my purpose.
Again, like I said, I will release it to CPAN within a month though I hope to be
able to release
it in the next week.
Regards,
David
----- Original Message -----
From: "Ovid" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, June 22, 2002 2:33 PM
Subject: Re: GET/POST handleing
--- [EMAIL PROTECTED] wrote:
> What would be better then useing the following? I'm lookign for something
> better and more secure. If there is such a thing
>
> sub SplitInput{
>
> $meth = $ENV{REQUEST_METHOD};
> if ($meth eq "GET") {
> $formInfo = $ENV{QUERY_STRING};
> } elsif ($meth eq "POST") {
> read(STDIN, $formInfo, $ENV{CONTENT_LENGTH});
> }
[snip]
Chris,
By the time you finish reading
http://www.easystreet.com/~ovid/cgi_course/lesson_two/lesson_two.html, you will be
able to
identify numerous bugs in this code. I know it's a popular way to parse form data,
but popular
doesn't mean good (just look at Windows :)
Cheers,
Curtis "Ovid" Poe
=====
"Ovid" on http://www.perlmonks.org/
Someone asked me how to count to 10 in Perl:
push@A,$_ for reverse q.e...q.n.;for(@A){$_=unpack(q|c|,$_);@a=split//;
shift@a;shift@a if $a[$[]eq$[;$_=join q||,@a};print $_,$/for reverse @A
__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]