CGI is not so hard

E

Eric J. Roode

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Thanks Juha for that post and you definitely made some great points
about the dangers of cuting and pasting code in a production
environment.

I'm still not 100% with you on CGI.pm. People around here seem very
loyal to it, but I have read in a lot of different places that it is
too large and slow, etc.

Yeah, I've read that too. I'm not sure I believe it. CGI.pm has 6700
lines in it, but fewer than 700 of them are compiled at startup. 3200
lines are POD documentation, located after the __END__ marker, so they are
ignored by the parser. The remaining 2700ish lines are subroutines which
are compiled only the first time they are invoked by user code.

So I don't see the problem, and in the real world, I haven't particularly
noticed a problem with CGI.pm's speed. (Especially if you use mod_perl or
FastCGI).

- --
Eric
$_ = reverse sort $ /. r , qw p ekca lre uJ reh
ts p , map $ _. $ " , qw e p h tona e and print

-----BEGIN PGP SIGNATURE-----
Version: PGPfreeware 7.0.3 for non-commercial use <http://www.pgp.com>

iQA/AwUBP0F+AWPeouIeTNHoEQLhPACfc1GMpAjk22IorKnKKB88EjMHmJkAn3e+
Up4kKPR0wjWbuWf+GaEVHnzi
=b653
-----END PGP SIGNATURE-----
 
H

hudson

Thanks Juha for that post and you definitely made some great points
about the dangers of cuting and pasting code in a production
environment.

I'm still not 100% with you on CGI.pm. People around here seem very
loyal to it, but I have read in a lot of different places that it is
too large and slow, etc.
 
T

Tad McClellan

hudson said:
I'm still not 100% with you on CGI.pm. People around here seem very
loyal to it, but I have read in a lot of different places that it is
too large and slow, etc.


Large, slow and correct vs. small, fast and incorrect.

Choose one.


[ exaggerated to make a point ]
 
H

hudson

Failing to deal with $key in similar fashion (to what is done for $value) is
a common mistake committed
by beginners, e.g., your parsing scheme wouldn't work well with any instance
of the submittal of

'a key like this';

because it would leave it in the form

'a+key+like+this'

Hi Bill,

I didn't deal with $key because I checked for a match for $key and I
wrote the html form. If a key is unexpected, it won't match, so there
are no worries:

my @form_variables= qw(variables_1
variables_2
etc
);

and later:

for my $variables (@form_varibles) {
if ($key eq "$varible") {
$kv{$key} = $value;
}
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,756
Messages
2,569,533
Members
45,007
Latest member
OrderFitnessKetoCapsules

Latest Threads

Top