in reply to real object persistence

Yes, mod_perl definitely can do that.

But if I were starting from scratch, I'd go the mod_fastcgi or mod_fcgid route. I really like CGI::Fast and find it's a convenient way to upgrade regular old CGI to the point of having persistence. It also means speed boosts that put perl up there with those other dynamic languages.

You can, of course, teach mod_perl to convert regular CGI to mod_perl CGI, but you have to then worry about things like your global my and global subs not working well together....

sub mod_perl_here { my $doesnt_work_like_you_expect = 7; sub sub_inside_sub_and_doesnt_look_like_it { print "$doesnt_work_like_you_expect <-- odd, it doesn't reinitiali +ze...\n"; } }

UPDATE: perrin, yes, I suppose that's true. I still say fastcgi is easier (or even better), unless you really need to get at the entire http protocol layer for some reason.

-Paul

Replies are listed 'Best First'.
Re^2: real object persistence
by perrin (Chancellor) on Aug 04, 2008 at 15:32 UTC
    The persistence of variables is identical in both environments and has the same issues. If you don't like the way ModPerl::Registry converts CGI scripts, that's fine, but it's not really relevant for someone starting from scratch. It's a tool for porting legacy code.