Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: Re: CGI made me bloated

by Arguile (Hermit)
on Oct 31, 2001 at 06:53 UTC ( #122270=note: print w/ replies, xml ) Need Help??


in reply to Re: CGI made me bloated
in thread CGI made me bloated

I'll bite. I think CGI takes on a bit too much as well. I love it's form handling, but it continues on way beyond the CGI. I'll keep using it for a couple of reasons though, the primary?

I don't know enough to confidently evaluate the alternatives:

This is just a partial list of the CGI namespace that deals with it. Some of them don't seem to be actively maintained (rather important). Is one of them a stripped down/refactored CGI.pm? How much testing have they gone through? CGI.pm is part of the standard distribution, should another become the de facto standard?

If Mr. Stein were willing maybe a group could help him factor the code out into some subclasses and have CGI.pm inherrit from them (for backwards compatibilty). This (to my rather unknowledgable view) would seem the best of both worlds. It would stay a standard while those wanting a lighter weight solution could use a base class. From what I understand thousands of development hours in writing and lots of testing went into CGI.pm. Even thinking of throwing that away seems criminal.

Update: Perhaps that "Even thinking of..." was a bit too much hyperbole. What I really meant was just abandonning the code base instead of exploring the possibility of refactoring is criminal. I agree completely that it is way too much bloat especially in a "typical" CGI environment (w/o mod_perl or the like).


Comment on Re: Re: CGI made me bloated
Re: Re: Re: CGI made me bloated
by Aighearach on Oct 31, 2001 at 07:16 UTC
    Cobol has had many more hours and testing thrown at it, is it criminal to program in Perl?

    Personally, I cut and paste 20 to 50 lines out of CGI.pm that I actually use into my CGIs, and leave the rest where it belongs... in a library on the disk, rather than parsed and compiled into my RAM. (even parts that aren't compiled take up cache space, to get started, so there is no way around extra resources being gobbled)

    But then, I'm not using it for HTML generation. I use HTML for that... along with HTML::Template of course. For people writing a CGI, most of CGI.pm is bloat, unless we've forgotten what "CGI" means. I think 90% of it should be split off into something like HTML.pm. Of course, momentum is going to prevent that, which is why I cut and paste a few functions... muchly that means the encoding and decoding functions...

    The good news is, since we should usually be using mod_perl anyways, Apache.pm doesn't suffer bloat in the same way.
    --
    Snazzy tagline here

      Mod_perl is nice, but it isn't portable. CGI.pm is. Hard as it may be to believe, Apache *isn't* the only web server on earth.
Re: Re: Re: CGI made me bloated
by strredwolf (Chaplain) on Oct 31, 2001 at 11:59 UTC
    CGI::Lite can be used in place of CGI if you're only using it to get at form options (and just printing out hand-carved HTML). I've used it myself and it's a fairly good, stable module to use w/o CGI's bloat.

    --
    $Stalag99{"URL"}="http://stalag99.keenspace.com";

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://122270]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (2)
As of 2014-11-29 08:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred Perl binaries come from:














    Results (204 votes), past polls