Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris

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

Replies are listed 'Best First'.
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?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://622382]
[stevieb]: daughter arrived from SF with Gandalf the bunny for his first international flight. Very wonderful Friday... like the holidays came early :)

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (4)
As of 2016-12-03 04:46 GMT
Find Nodes?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:

    Results (52 votes). Check out past polls.