in reply to How Much Is Too Much (on one line of code)?
Way too much. It would almost be tolerable if it were:
</tongue>
but maybe that's just me. I always put postfix modifiers on their own line, indented, unless they are for control constructs. I find them much more digestible.my $country = $card->country; $country = $country eq 'gbr' ? '' : uc "[$country]" if $country;
<tongue where='in-cheek'>
The proper way to do this would of course be something like:
but I don't have quite enough room left in the margin of this post for the error handling.my $country; eval { my $countryId = Country::Identifier->new(id => $card->country); $country = Country::Factory->new(id => $countryId); my $cntry_formatter = Formatter::Factory->new(action => sub { "[" . shift() . "]" }); $country->apply(Iterator->new(type => "closure", args => [ $cntry_formatter ])); }
</tongue>
|
---|
In Section
Seekers of Perl Wisdom