The regex is now updated to include all the chars $%&*;@[\] I got the list of chars from here http://perldoc.perl.org/perlsub.html#Prototypes This is the diff, please let me if it can be improved: diff --git a/lisp/progmodes/perl-mode.el b/lisp/progmodes/perl-mode.el index a516f07..43eb462 100644 --- a/lisp/progmodes/perl-mode.el +++ b/lisp/progmodes/perl-mode.el @@ -257,7 +257,7 @@ (1 (prog1 "\"" (perl-syntax-propertize-special-constructs end)))) ;; Funny things in `sub' arg-specs like `sub myfun ($)' or `sub ($)'. ;; Be careful not to match "sub { (...) ... }". - ("\\ wrote: > Евгени Колев writes: > > > > > After giving some thought to this, I think we can instead > > make the regex more strict so that it matches only the > > allowed characters in perl's prototypes. The allowed chars > > are: $%&*;@[\] > > > > This is what I have in mind - diff is pasted below. > > However, please note the change below doesn't handle > > these 3 chars [ / ] I'll add them if you think this is the correct > > approach: > > Yeah, that looks right to me (although I don't know perl very well). >