I have previously built sites using PHP, where I automatically included header and footer html using the following lines in .htaccess on an Apache host:

php_value auto_prepend_file "/var/www/html/parts/header.htm"
php_value auto_append_file  "/var/www/html/parts/footer.htm"

In these files I could put executable PHP code.

My current project is written in Perl, not in PHP.

Is there any way to automatically prepend and append executable Perl files using .htaccess?


It depends on how exactly you're using perl. There are several different frameworks that would do what you want - e.g. HTML::Mason has the autohandler that will load stuff for you. There's also a perl module called Apache Sandwich that might be what you're looking for.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.