Re: mini-quiz

Greg Matheson <[email protected]> Tue, 19 Jun 2007 06:45:58 +0800
Newsgroups gmane.comp.lang.perl.qotw.discuss
Message-ID <[email protected]>
On Mon, 18 Jun 2007, Yitzchak Scott-Thoennes wrote:

> Ovid, on perlmonks, asks[1] if this code is doing too much on one line:

>     my $country = $card->country;
>     $country = $country eq 'gbr' ? '' : uc "[$country]" if $country;

The problem is understanding what 'gbr' is and why you would want
to delete it. Great Britain, because that is the country the code
is running in? Alternatively, the problem is caused by a 
difficult branching.

      my $country = $card->country;
      $country = uc "[$country]" if $country;
      $country = '' if $country eq '[GBR]';


> [1] Ovid's question, without the (already quite a few) replies:
> http://perlmonks.org/?displaytype=print;node_id=621769

-- 
Greg Matheson                If there is one thing we learn from the 
                             study of language learning, it is that
                             language learners learn more than we learn.  

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.