in reply to perltidy list formatting
By default, perltidy handles list with fat commas differently than plain lists. See "Controlling List Formatting" in the perltidy man page. This worked for me:
Output:perltidy -st -cab=1 -mft=1 -lp -vt=1 -boc PM_503139_02.pl
Key:my @list = ( '1', '2', '3', ); my %hash = ( a => '1', b => '2', c => '3', );
The real problem was in stopping @list from being flattened into one line, which perlytidy wants to do whenever the list *could* fit on a single line. The '-boc' flag, which tells it to using existing linebreaks, keeps @list in multi-line form, but this may be non-optimal for formatting the rest of your program.-boc --break-at-old-comma-breakpoints -mft=n --maximum-fields-per-table=n -cab=n --comma-arrow-breakpoints=n -lp --line-up-parentheses -pt=n --paren-tightness=n -vt=n --vertical-tightness=n -vtc=n --vertical-tightness-closing=n
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: perltidy list formatting
by perrin (Chancellor) on Oct 26, 2005 at 21:37 UTC |