in reply to Re: How Much Is Too Much (on one line of code)?
in thread How Much Is Too Much (on one line of code)?
my $country = $card->country; $country = $country ? $country eq q{gbr} ? q{} : qq{[\U$country]} : q{};
I am unsure of the best way to lay out nested ternaries but have found the above indented multi-line approach, with associated condition, true and false all aligned, quite readable. Others may disagree.
Cheers,
JohnGG
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: How Much Is Too Much (on one line of code)?
by naikonta (Curate) on Jun 18, 2007 at 14:30 UTC | |
by johngg (Canon) on Jun 18, 2007 at 15:36 UTC | |
by naikonta (Curate) on Jun 18, 2007 at 15:49 UTC | |
by johngg (Canon) on Jun 18, 2007 at 15:58 UTC | |
|
Re^3: How Much Is Too Much (on one line of code)?
by Herkum (Parson) on Jun 19, 2007 at 11:27 UTC |