in reply to perltidy for ternary operator?
I looked into PBP and that's not what it says!
It recommends to
Format cascaded ternary operators in columnsand that's exactly what the -pbp switch does:
lanx@lanx-1005HA:~$ cat /tmp/tst.pl my $var1 = $condition ? $val_for_true : $val_for_none ; my $var2 = $condition ? $val_for_true : $condition2 ? $val_for_ +true2 : $val_for_none ; lanx@lanx-1005HA:~$ perltidy -pbp /tmp/tst.pl my $var1 = $condition ? $val_for_true : $val_for_none; my $var2 = $condition ? $val_for_true : $condition2 ? $val_for_true2 : $val_for_none;
I'd appreciate if you'd fix the typo in the title, provide links to documentation of the modules (like perltidy) and chapters (like "Ternaries") you are questioning.
Cheers Rolf
(addicted to the Perl Programming Language and ☆☆☆☆ :)
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: perltidy for ternary operator?
by TomDLux (Vicar) on Dec 06, 2014 at 18:54 UTC | |
by LanX (Saint) on Dec 06, 2014 at 19:06 UTC | |
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 |
In Section
Seekers of Perl Wisdom