in reply to CGI made me bloated

Well, me personally, your title tickled me. But reading the post, I don't see any strong arguments against using CGI...

Regarding namespace issues, use the object syntax instead of the procedural syntax. And I guess the HTML element creation aspects can be seen by some to be overkill, but memory is cheap. So I don't see that as a big problem either.

And what does libwww-perl have to do with this discussion? The modules serve entirely different purposes. And regarding referring to CGI.pm as "old", well, you can also consider that to mean well-debugged, mature and time-tested. Furthermore, your quote states unequivocally that he is still working on the module on a regular basis, so it is far from being out of date.

Did you have some valid gripe with CGI? If so, do state it. And check out Apache::Emulator which just came out which has a neat way of making it so that CGI programs can move to mod_perl with no porting... Apache::Registry inverted.

Replies are listed 'Best First'.
Re: Re: CGI made me bloated
by tstock (Curate) on Oct 31, 2001 at 08:30 UTC
    I think he was pretty clear on his gripes with CGI.

    CGI.pm does more than it should, it's not neat and the "mainstream perl culture" pushes it mainly due to its status. Nothing serious, just his view and shared by some others including the CGI.pm author himself.

    I think CGI.pm could be renamed... possibly to a name that reflects all that it does and its size. Who likes CGI-HTML-HTTP-BundleByStatus.pm ?

    Even as I say this, I recommend it to everyone learning perl, just don't get to attached to it :)

    Tiago
Re: Re: CGI made me bloated
by mattg (Novice) on Oct 31, 2001 at 09:22 UTC
    I'm really not looking for a fight over CGI.pm, I just wanted to hear what other people had to say about it. I also use the module quite extensively when I have to write any scripts for the web, but my point is that I hardly use it for anything but obtaining parameters from html forms.

    As well, I was not making the claim that the LWP modules should be used instead of CGI.pm, but the name just sprung to mind when I was thinking of another web-related module to chant rhythmically to myself.

    My gripe, then, if I have to have one, is whether there is a need for so much baggage and repetition among modules? It seems that a lot of CGI.pm has fallen by the wayside as newer and more task-specific modules have been developed, so why hold on to all the bloat?

    matt

      If you are writing web client software, not using LWP would be a major oversight. So yes. Add that to the chanting litany. :)

      I've used CGI for fun and have just started using it for profit just last week. I agree that it would be nice to have a module that was more easily broken down into its functional elements, but given that what we have works I don't see compelling reasons to change it-- at least not quickly.

      On the server, my first guess is that speed is related more to your processor, your RAM, and whether or not you are maintaining your perl script in memory using something like mod_perl, than it is going to be related to whether or not the CGI module itself is "bloated".

      As to whether we are "over loading" by bringing in functionality that we aren't going to use when we "use CGI;", so what? Every time I load perl I load lots of stuff I don't need-- it's an inherent danger in an interpreted language. The resulting executable is a hybrid of the interpreter and my code. And with a language that allows fancy stuff like eval() it gets even worse. Imagine a native C program that compiled and ran variable C code on the fly. (There's your spooky thought for Halloween. *grin* )