Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re^2: How Much Is Too Much (on one line of code)?

by barrachois (Pilgrim)
on Jun 20, 2007 at 06:56 UTC ( #622189=note: print w/ replies, xml ) Need Help??


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

I like this approach, too; the hash makes exceptions to the "uppercase bracket" basic rule perfectly clear. However, I also agree with other posters (1) treating $country as a temporary variable isn't great practice, and (2) it's not entirely clear what $card->country is allowed to return. Given those concerns, my own preference would be

my %exceptions = ('' => '', gbr => ''); my $c = $card->country || ''; my $country = exists($exceptions{$c}) ? $exceptions{$c} : uc "[$c]";


Comment on Re^2: How Much Is Too Much (on one line of code)?
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://622189]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (11)
As of 2015-07-31 11:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (276 votes), past polls