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 ☆☆☆☆ :)
In Section
Seekers of Perl Wisdom