I would like to highlight all the HereDocs in a particular perl file as perl code. For example, I'd like to apply the normal perl highlighting to the subroutine in this HereDoc:
my $code = <<'CODE';
sub test {
say "this is a test";
};
CODE
I thought I could do this with something like:
syn region perlHereDocPL start=+<<\s*'\z([^\\']*\%(\\.[^\\']*\)*\)'+ matchgroup=perlSnip end=+^\z1$+ contains=@perlTop
But apparently this doesn't work like I thought it did. Thanks!