Well, one can use PHP as a CGI scripting language, so I'd assume so...
However, do you have to tell the server what language to parse with at the head of the file? Say it's /usr/bin/perl (or whatever), how would you change it 'midstream'.....
I need to go check out my webserver, you've made me curious....