Quoth Rolf:
The OP is using a function which is not standard indenting, hitting TAB is.°
I quite categorically am using the standard indenting of cperl-mode. Copy the original example into a file called, say "test.pl", then edit with emacs -Q test.pl, and take the following sequence of instructions:
M-X cperl-mode
C-SPC
M->
M-C-\
gives me (copy-pasting from Emacs window):
my @headings = (
{
key => 'k', name => 'Kanji', class => 'kanji'},
{
key => 'skip', name => 'SKIP', class => 'skip-code'},
{
key => 'co', name => 'Suggestion', class => 'skip-code'},
{
key => 'disc', name => 'Discussion'},
);
The version of Emacs I am using is as follows:
GNU Emacs 27.1 (build 1, i386-portbld-freebsd12.1, GTK+ Version 3.24.2
+4, cairo version 1.16.0)
Copyright (C) 2020 Free Software Foundation, Inc.
The cperl-mode is the default supplied with the above.