in reply to Having trouble with pperl (Persistent Perl) and CGI

I believe the problem you're having here is that CGI.pm is a totally insane piece of code that uses global variables everywhere. To make it work in a persistent environment, you have to call CGI::initialize_globals() at the beginning of every request. It does this automatically when it detects mod_perl.
  • Comment on Re: Having trouble with pperl (Persistent Perl) and CGI

Replies are listed 'Best First'.
Re^2: Having trouble with pperl (Persistent Perl) and CGI
by Your Mother (Archbishop) on Apr 24, 2008 at 21:45 UTC

    I did not even know that. Nice. It explains, I think, the problem I've seen using CGI inline in TT2 templates from within Catalyst. [% USE CGI %] hangs the server (on submits IIRC) while [% USE CGI(foo) %], fake initializer, works fine. Now I know why. :)

      This sounds a lot like what would happen if you had read STDIN already before calling new CGI(). If you just want to create a CGI object without it trying to automatically read the script's input, you can initialize it with an empty string: new CGI("").
Re^2: Having trouble with pperl (Persistent Perl) and CGI
by Anonymous Monk on Apr 24, 2008 at 22:16 UTC
    that was indeed the problem . Can't believe google hadn't indexed somebody having this problem before-- it's 2008 for goodness sake. Anyway, thanks :)
Re^2: Having trouble with pperl (Persistent Perl) and CGI
by ayapejian (Novice) on Apr 25, 2008 at 12:13 UTC
    Worked perfectly ... thanks everyone for the help