|The stupid question is the question not asked|
[RESOLVED] Migrating mod_perl app to mod_perl 2by cLive ;-) (Prior)
|on Oct 31, 2014 at 18:32 UTC ( #1105746=perlquestion: print w/replies, xml )||Need Help??|
cLive ;-) has asked for the wisdom of the Perl Monks concerning the following question:
This is more of a "rubber duck" debug than anything, but I've reached a point where I think I need an external set of eyes.
I'm tasked with migrating a mod_perl app to mod_perl 2. For the last couple of weeks, it's been reasonable (run code, get error, convert code call, check it works, move on...). But now I've hit a wall and I'm not sure how to proceed.
The app uses chained PerlResponseHandlers (was PerlHander in mp1) to process plain CGI scripts and thern to wrap them in a presentation layer (this is a really old school framework, and I'm not meant to be improving it, just get it to work).
The apache config for the section I'm on is like this:
The APP::Page module inherits from Apache::Forward, a local module based on code "Taken from Stein & MacEachern's book" (which I don't have a copy of with me, alas :) Here's the handler code from the module:
There's also TIEHANDLE, PRINT and forward methods in the class. Two things I notice when running this under mod_perl2:
I'm not 100% sure how the chained handlers work. I assume from right to left in the Apache config. But what about the tied STDOUT? Is that meant to be being defined explicitly somewhere initially? I grepped the code base for other ties to STDOUT, and I can't see any outside of this module.
I tried just dropping in use Apache2::compat into startup.pl, but that doesn't appear to have any affect on this.
I also notice in 15.4 of the ModPerl Cookbook a section on Filtered content where PerlSetVar Filter On is added to the config. Now I'm wondering why this code doesn't use that and whether I should be migrating the code to use it? Hmmm.
The mod_perl migration guide doesn't have any info on this. I'm assuming I should be reading up on details of stacked handlers or something similar. What should I be reading to get up to speed on how this worked under mod_perl 1, and how to get it working under mod_perl 2? (and any other insights welcomed).
Update: Found this presentation, which pretty much covers what I need to know. Long story short I need to look at Apache2::Filter
Back to Seekers of Perl Wisdom