http://qs1969.pair.com?node_id=922952


in reply to Re^4: source filtering and mod_perl2
in thread source filtering and mod_perl2

Looking at (the source of) Apache::PerlRun, it basically is:

my %orig_inc = %INC; my $eval = join '', 'package ', $package, ';use Apache qw(exit);', $line, $$code, "\n"; $rc = $pr->compile(\$eval);

... and as $code gets loaded by a plain file read, source filters never get the chance to actually modify the code.

You could maybe use a two-level scheme of having the first code be a wrapper that loads your to-be-filtered code. Personally, I would look instead at Plack/PSGI, which eliminates much of the middle man and should work with source filters. When it comes to deploying, source filters also should still work, and if not, you can always use Apache as a transparent proxy in front of your plack application.