This was bugging me, so I played around with it a bit more.

It seems this has nothing to do at all with version control etc, but with the number of underscores.

I could reproduce it on my private machine with a clean emacs 29.3 install by:
- C-x C-f foo.pl
- M-x cperl-mode
- just keeping underscore pressed

Emacs will slow down eventually and then hang. Haven't waited long enough to see if it recovers.

Hope this helps.

On Tue, May 14, 2024 at 8:46 PM Patrick Goldmann <patrick.goldmann@gmail.com> wrote:
Just got home and tried to reproduce this on my private machine, it worked just fine.

So I guess this is something on my work machine, maybe version control related or something.
Still strange this happened while running emacs -Q.

I can try your file tomorrow, but my guess is if I drop this into one of my project directories it won't work.
I'll try it outside of version controlled directories, too, and provide an example file.

But if it turns out this is somehow related to version control or something else in my project tree, this will be hard to debug and might not even be directly related to cperl-mode at all :(

On Tue, May 14, 2024 at 8:20 PM Harald Jörg <haj@posteo.de> wrote:
Patrick Goldmann <patrick.goldmann@gmail.com> writes:

> While trying to open files (with cperl-mode, perl-mode works)
> containing comments of this sort, emacs hangs.

Unfortunately I can not reproduce this.  I tried on Windows with exactly
the same Emacs version with the attached file, and it works as expected.

Can you pleas try this file, and provide a file where Emacs hanvs?
--
Cheers,
haj