Subject: bug#5064: 23.1.50; perl mode coloring gone if subroutine name is one letter long

From: Stefan Monnier <[email-masked]>
Date: Sat, 28 Nov 2009 14:41:03 -0500

> Gentlemen, consider the following perl subroutines.
> Notice how the latter has all its coloring gone, just because it starts
> with one letter. (perl-mode)^X^E

> sub max {
>     my $max = shift(@_);
>     foreach $foo (@_) {
>         $max = $foo if $max < $foo;
>     }
>     return $max;
> }
> sub m {
>     my $max = shift(@_);
>     foreach $foo (@_) {
>         $max = $foo if $max < $foo;
>     }
>     return $max;
> }

Actually, the problem is not really that it's only one letter, but that
it's the "keyword" m, used for matching (as in "m/regexp/").  Of course
the same can happen with other keywords like "s", "tr", "y", "q", "qx",
and various others.

I'm not sure if such a function definition is valid.  Does Perl accept
it and can you actually call this function?

        Stefan