in reply to Re^2: perltidy for ternary operator?
in thread perltidy for ternary operator?
But that's not a problem with perltidy, cause cascades (as demonstrated) would be fixed automatically.
And I doubt that breaking simple ternaries would be appreciated by the majority.
It might interest you that tidy's output of a simple ternaries depends on existing linebreaks: (see -bot option)¹
lanx@lanx-1005HA:~$ cat /tmp/tst.pl my $var1 = $condition ? $val_for_true : $val_for_none ; #own linebreak my $var2 = $condition ? $val_for_true : $val_for_none ; lanx@lanx-1005HA:~$ perltidy -pbp /tmp/tst.pl my $var1 = $condition ? $val_for_true : $val_for_none; #own linebreak my $var2 = $condition ? $val_for_true : $val_for_none;
Since the documentation mentions ternaries only once for -bot I doubt your goal can be achieved! (i.e. without patching the code)
Cheers Rolf
(addicted to the Perl Programming Language and ☆☆☆☆ :)
¹) i.a.W if you expect the ternary to be cascaded in the future then enter a linebreak manually.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: perltidy for ternary operator?
by TomDLux (Vicar) on Dec 06, 2014 at 21:36 UTC | |
by atcroft (Abbot) on Dec 07, 2014 at 04:51 UTC | |
by LanX (Saint) on Dec 06, 2014 at 22:24 UTC |