Subject: bug#74245: 30.0.92; CPerl subroutine signatures are left open when last param is $

From: Harald Jörg <[email-masked]>
Date: Sun, 12 Jan 2025 00:34:57 +0000

Stefan Kangas <[email-masked]> writes:

> Peter Oliver <[email-masked]> writes:
>
>> Perl subroutine signatures can include a variable with no name, just
>> a bare $, to indicate that a parameter should be ignored.  If this
>> happens in the last place, CPerl mode in Emacs 30.0.92 mishandles
>> it, and is unable to see the closing ).  Consequently, it matches
>> parentheses incorrectly, and misindents subsequent blocks.
>>
>> I have a test that I will send in as a patch, once I have a bug number.
>>
>> This issue is not present in Emacs 29.4.
>
> Harald, could you please take a look at this?

I apologize, for some reason this bug report slipped by me.  I'll have a
look next week.  I can reproduce the bug.

On first glance, there's a workaround: Add a trailing comma to the
parameter list.  Ugly, but prevents the indentation from being messed up:

    sub ignore ($first, $,) {}

-- 
Cheers,
haj