> > From my experience does cperl not attempt to format nested data structures

> It shouldn't, but it does.

what I meant was that cperl doesn't attempt to mimic Data::Dump et al. (Many posters in this thread imply otherwise.)

Which is a good thing, because the decision how to read the data must be left to the programmer.

This particular example might have a "tabular interpretation" but others may not.

> (see example here)

oops, I was AFK and missed that

> If you want M-x cperl-indent-region and M-x cperl-indent-exp to do indentation and nothing else, set cperl-indent-region-fix-constructs to nil.

I can confirm this works.

One quick solution could be to have another function cperl-format-region which activates the fix-construct flag internally.

Tho having heuristics to distinguish between block and hash to avoid this problem would be nice.

I'm also having another effect with 27.1 now

{key    => 'k',...

If I type a space between { and key , a TAB is introduced before the fat-comma => ?

Can't be seen in 24.3 I'd say it's related to new global auto-indent settings in emacs.

That's what I get after inserting a space after all {

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'}, );

UPDATE: Sorry, strike that. Seems like I had "silent" TABs in the code, which only jumped when a space was introduced.

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


In reply to Re^4: How would you indent this? (cperl-indent-region) 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.