Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

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

by simonm (Vicar)
on Jun 20, 2007 at 20:11 UTC ( #622382=note: print w/ replies, xml ) Need Help??


in reply to How Much Is Too Much (on one line of code)?

Why use two lines, when one will do? (*grin*)

my ($country) = map { ( ! $_ or $_ eq 'gbr' ) ? '' : "[$_]" } $card- +>country;
(And yes, I know this doesn't preserve values of zero or undef, but it seems unlikely that's desirable...)


Comment on Re: How Much Is Too Much (on one line of code)?
Download Code
Re^2: How Much Is Too Much (on one line of code)?
by Anonymous Monk on Jun 21, 2007 at 09:04 UTC
    well said...
    and much much more readable....the best one so far....

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (14)
As of 2015-07-06 11:21 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 (72 votes), past polls