Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

I've been having problems with getting defunct processes from Apache. When quickly refreshing an %ENV printing script that uses CGI simply for the headers, I get many defunct processes. When I remove CGI and manually print out the header, I get about 10% of the defunct processes I got before. I just had the admin upgrade to the lastest CGI.pm and it didn't help much. (Server is running RH 7.1 with Apache.)

Is there a more light-weight version of CGI.pm? All I use it for is param, url_param, and cookie. I'd imagine someone would have thrown together a not-250k version that handles only those as they all serve a similar purpose.

I'd really appreciate any insight you may offer. Thanks.

Replies are listed 'Best First'.
Re: CGI.pm Causes Slowdown
by Masem (Monsignor) on Dec 20, 2001 at 20:02 UTC
    The next version of CGI.pm, available at CPAN as CGI3.pm, will break the various 'functions' of CGI into several submoudles, allowing you to only use those parts that you need. It's still considered beta quality, but it's there for you to experiment with.

    There's also CGI_Lite which may not be as robust in error/taint checking as CGI.pm, but only does the CGI environment parsing.

    -----------------------------------------------------
    Dr. Michael K. Neylon - mneylon-pm@masemware.com || "You've left the lens cap of your mind on again, Pinky" - The Brain
    "I can see my house from here!"
    It's not what you know, but knowing how to find it if you don't know that's important

Re: CGI.pm Causes Slowdown
by tachyon (Chancellor) on Dec 20, 2001 at 20:43 UTC

    Yes there is a more compact version of CGI.pm. I have just finished a refactoring of CGI.pm to extract all the CGI related functionality and remove the HTML stuff. It is called CGI::Simple. It uses the CGI.pm interface so is plug and play compatible. The documentation is extensive. You can find a copy of it here

    Note: This module is undergoing (reasonably extensive) alpha testing currently but will not be released onto CPAN until it appears bulletproof - this is to avoid merlyn shooting me :-)

    tachyon

    s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print

Re: CGI.pm Causes Slowdown
by larryk (Friar) on Dec 20, 2001 at 19:56 UTC
    I haven't used it but CGI::Lite may be what you are looking for.
       larryk                                          
    perl -le "s,,reverse killer,e,y,rifle,lycra,,print"
    
Re: CGI.pm Causes Slowdown
by techy (Scribe) on Dec 20, 2001 at 21:54 UTC
    If you are using mod_perl (such as with Apache::Registry), you might want to consider Apache::Request and Apache::Cookie. These modules are smaller and faster than CGI.pm, and do not have the HTML formatting functions. Thanks,

    techy