in reply to How Much Is Too Much (on one line of code)?
When you have to write code that reads left to right and then right to left you are trying to do two things on the same line that lacks clarity.
If I saw this in production code I would hate forever the person who wrote it.
How about this instead,
my $country = (not $card->country) ? q{} : $card->country eq 'gbr' ? q{} : uc "[$country]";
It is only a little more verbose but it is clear at presenting the results of any specific situation.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: How Much Is Too Much (on one line of code)?
by johngg (Canon) on Jun 18, 2007 at 13:47 UTC | |
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 | |
by Herkum (Parson) on Jun 19, 2007 at 11:27 UTC |
In Section
Seekers of Perl Wisdom