Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
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 chanting in the Monastery: (17)
As of 2014-07-28 13:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (199 votes), past polls