If I want compactness in emacs I usually break into the next line
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'}, );

I don't know where you got the break after the opening curly from

{ key => 'disc', name => 'Discussion'},

(Update: *I can't reproduce this!* I can now, see reply )

BUT cperl-mode offers 8 indent-styles (also available from the menu)

M-x cperl-set-style BSD C++ CPerl Current GNU K&R PerlStyle Whitesmith

... and plenty of customizations

Cperl Indentation Details group: Indentation. State : something in this group has been changed outside custom +ize. Show Value Cperl Brace Imaginary Offset Imagined indentation of a Perl open brace that actually follows a s +tatement. Hide An open brace following other text is treated as if it were this fa +r to the right of the start of its line. Show Value Cperl Brace Offset Extra indentation for braces, compared with other text in same cont +ext. Show Value Cperl Break One Line Blocks When Indent Non-nil means that one-line if/unless/while/until/for/foreach BLOCK +s Hide need to be reformatted into multiline ones when indenting a region. Show Value Cperl Close Paren Offset Extra indent for substatements that start with close-parenthesis. Hide Cperl Comment Column: 40 State : SAVED and set. Column to put comments in CPerl (use M-x cperl-indent to lineup wit +h code). Show Value Cperl Continued Brace Offset Extra indent for substatements that start with open-braces. Hide This is in addition to cperl-continued-statement-offset. Show Value Cperl Continued Statement Offset Extra indent for lines not starting new statements. Show Value Cperl Fix Hanging Brace When Indent Non-nil means that BLOCK-end `}' may be put on a separate line Hide when indenting a region. Braces followed by else/elsif/while/until are excepted. Show Value Cperl Indent Comment At Column 0 Non-nil means that comment started at column 0 should be indentable +. Show Value Cperl Indent Left Aligned Comments Non-nil means that the comment starting in leftmost column should i +ndent. Hide Cperl Indent Level: 2 State : CHANGED outside Customize. Indentation of CPerl statements with respect to containing block. Show Value Cperl Indent Parens As Block Non-nil means that non-block ()-, {}- and []-groups are indented as + blocks, Hide but for trailing "," inside the group, which won't increase indenta +tion. One should tune up `cperl-close-paren-offset' as well. Show Value Cperl Indent Region Fix Constructs Amount of space to insert between `}' and `else' or `elsif' Hide in `cperl-indent-region'. Set to nil to leave as is. Values other than 1 and nil will probably not work. Show Value Cperl Indent Wrt Brace Non-nil means indent statements in if/etc block relative brace, not + if/etc. Hide Versions 5.2 ... 5.20 behaved as if this were `nil'. Show Value Cperl Label Offset Offset of CPerl label lines relative to usual indentation. Show Value Cperl Lineup Step `cperl-lineup' will always lineup at multiple of this number. Hide If nil, the value of `cperl-indent-level' will be used. Show Value Cperl Merge Trailing Else Non-nil means that BLOCK-end `}' followed by else/elsif/continue Hi +de may be merged to be on the same line when indenting a region. Show Value Cperl Min Label Indent Minimal offset of CPerl label lines. Show Value Cperl Regexp Indent Step Indentation used when beautifying regexps. Hide If nil, the value of `cperl-indent-level' will be used. Show Value Cperl Tab Always Indent Non-nil means TAB in CPerl mode should always reindent the current +line, Hide regardless of where in the line point is when the TAB command is us +ed.

you might wanna read the micro-docs in the menu and experiment.

Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery


In reply to Re: How would you indent this? (emacs) by LanX
in thread How would you indent this? by no longer just digit

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.