Way too much. It would almost be tolerable if it were: my $country = $card->country;
$country = $country eq 'gbr' ? '' : uc "[$country]"
if $country;
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.
<tongue where='in-cheek'>
The proper way to do this would of course be something like:
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 ]));
}
but I don't have quite enough room left in the margin of this post for the error handling.
</tongue>
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|