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)?

From the original code, it's clear that $card->country could be "", and, if so, shouldn't get brackets. But you've come closest to how I'd like to think I'd do it (assuming $card->country is always at least defined):
my $country = uc("[" . $card->country . "]"); $country = '' if $country eq "[GBR]" || $country eq "[]";
(This differs from the original if $card->country starts off as uppercase GBR, or if $card->country is 0 or undef or some overloaded object that acts false, but I'm guessing that's a good thing.)