Anyone who has edited Perl code in Emacs (in CPerl mode, or the older Perl mode) knows that it doesn't properly recognize ${aaa}, because it ignores the first curly after the dollar sign (because it thinks it might be a variable), causing the second curly to screw up the paren matching and identing. I always figured the mode was just coded wrong and needed improving, but was surprised that in many versions of Emacs, nobody had fixed this bug. Nor was there a new CPerl mode available that fixes this.
Only recently did I finally find documentation that described why these problems aren't getting fixed. Emacs is too dumb to parse Perl 5, so programmers just have to live with CPerl's idiosyncracies. CPerl comes with help files that describe work-arounds, which you just have to live with:
${aaa}breaks paren matching and indentation. Instead, use$ {aaa}, which is valid in Perl 5 (though not in Perl 4).$a='500$';causes the second quote to be ignored, convincing CPerl that the quote is still open. You can change CPerl's mind like this:$a='500$'; # ';- Certain regexp paren characters confuse CPerl. For example,
s#//#/#looks like a comment and will be colored as such, soif (s#//#/#)will mess up paren matching and indentation.s"abc"def"confuses CPerl "a lot". - PODs are only basically understood, and here-documents are not treated at all (though highlighting and indentation are inhibited within the blocks).
It's sad that Emacs has to change before we can get proper coloring and indentation in Perl, but you can't entirely blame Emacs: Perl's syntax is awfully wacky. It seems like that if the Perl interpreter can understand it, Emacs should also be able to, but to expect it to be able to do it on the fly is awfully demanding. Oh well.
This is why you should use pico. *cough*