in reply to cperl mode, XEmacs, and Test::Inline

You're probably going to want to look into mmm-mode. It lets you have multiple modes active in a buffer inside different regions (for example for Mason components it behaves like HTML mode by default, but inside <%init></%init> blocks and what not it switches to cperl-mode).