I took over a website using ePerl that let you embed perl code into your HTML webpage and have it go through a filter before sending the page to the client.
The current procress is like a Server Side Include that runs a perl script. In this case the script was just:
% MyApp->Ad()
Moving over to HTML::Mason as ePerl is ancient I found that Mason worked for
static files, but it didn't take the input from a previous filter.
Here's my httpd.conf file:

SetHandler perl-script
PerlHandler HTML::Mason::ApacheHandler



SetHandler perl-script
PerlSetVar Filter On
PerlHandler MyApp::HTML HTML::Mason::ApacheHandler


The bolded part wasn't working.
So I created MasonX::ApacheHandler::LastFilter to solve this. It uses
HTML::Mason::Resolver::Null included with the Mason bundle.
Here's the file. Put it under
Your perl module location of /MasonX/ApacheHandler/
To use it change the above httpd.conf to:
PerlHandler MyApp::HTML MasonX::ApacheHandler::LastFilter
And you should be good to go.