Subject: bug#72296: 29.4; cperl-mode parsing error

From: Eli Zaretskii <[email-masked]>
Date: Thu, 25 Jul 2024 22:06:03 +0300

> Cc: [email-masked]
> From: Andrea Corallo <[email-masked]>
> Date: Thu, 25 Jul 2024 13:01:30 -0400
> 
> brian <[email-masked]> writes:
> 
> > I started emacs using 'emacs -Q /tmp/some-empty-file.pl' and activated
> > cperl mode by 'M-x cperl-mode'. I typed 'for (2..$n/2) {}' into the
> > empty buffer and as soon as I pressed '/' there was an error message in
> > the minibuffer
> >
> > End of ‘/ ... /’ string/RE not found: (scan-error Unbalanced
> > parentheses 11 38)
> >
> > and syntax hilighting was broken. Inserting a single space before '$'
> > cleared the error and fixed the hilighting.
> >
> >
> >
> > In GNU Emacs 29.4 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.24.38,
> > cairo version 1.18.0) of 2024-06-24 built on dev
> > Windowing system distributor 'The X.Org Foundation', version 11.0.12302000
> > System Description: Ubuntu 23.10
> 
> I might be doing something wrong but I cannot reproduce on emacs-30,
> could you confirm?  29 is not under development anymore.

I can reproduce on master.  Be sure to invoke cperl-mode, and type
exactly the text the OP shows.