Hello, and thanks in advance for your patience as I ask how to do something rudimentary, but I seem to be rather dense and a week up to my eyeballs in documentation has left me no closer than when I began.

My problem is that I'm trying to pick up mod_perl2 without ever having used mod_perl before. I've got a ton of scripts in perl using CGI.pm, and I don't mind doing a bit of rewriting; some of that code is very old, and it's a good excuse to go back and clean up.

Most of what I've read suggests that what I've been doing with CGI.pm should be replaced by Apache::Request. In fact, my module that uses CGI.pm throws errors when included in startup.pl:

Can't locate object method "new" via package "CGI" (perhaps you forgot to load "CGI"?)

...which it doesn't do if I leave the module out of startup.pl and just use it in individual scripts. I have "PerlModule Apache2 CGI DBI" in my /etc/httpd/conf.d/perl.conf file, so I don't need to use() it. I've been led to understand that there is a performance benefit to including frequently-used modules in my startup.pl file, and I'd like to take advantage of that benefit.

So I've set to trying to replace CGI.pm entirely in one particular module. It looks as though Apache::Request would have been my path in mod_perl 1.x and I've been looking at http://perl.apache.org/docs/2.0/user/porting/compat.html (among other places) for what to do.

Under $r->request it says "Use Apache->request".

Under Apache->request it says "Apache->request usage should be avoided under mod_perl 2.0 $r should be passed around as an argument instead"

...so I'm stumped.

The docs for 2.0 don't seem as complete as the docs for mod 1.0, which makes perfect sense since 2.0 seems to still be not quite complete. But it's pretty difficult to keep track of what from the 1.0 docs applies to 2.0 and what doesn't. All things being equal, I'd really rather learn the current ways than to learn the old ways and immediately unlearn them. But I need a bit of guidance here.

My apologies, I seem to be unclear on a number of concepts here, and it's hard to get enough reference points to form a foundation to help me put this all together. I'll appreciate even being told what an idiot I am, as long as I get a little closer to a clue.

My system is Fedora Core 1, Apache/2.0.49 (Magic Number: 20020903:7) installed from RPM (httpd-2.0.49-1.1) and mod_perl-1.99_14 compiled from tarball (it had been installed from RPM, but I read that I shouldn't even bother asking questions on this list unless I had the most current version, and doing an RPM ugrade to 1.99_14 from 1.99_12 broke everything, so I rpm -e'ed it and installed from tarball--it works fine now)

Thanks again, and my apologies for not being able to formulate a more concise question.


Steve


-- Report problems: http://perl.apache.org/bugs/ Mail list info: http://perl.apache.org/maillist/modperl.html List etiquette: http://perl.apache.org/maillist/email-etiquette.html



Reply via email to