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 ForgotPasswordAgain (Deacon)
on Jun 18, 2007 at 17:01 UTC ( #621827=note: print w/replies, xml ) Need Help??


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

I think it's too much.

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

That, or:

my $country = $card->country; if ($country and $country ne 'gbr') { $country = uc("[$country]"); } else { $country = ''; }

Replies are listed 'Best First'.
Re^2: How Much Is Too Much (on one line of code)?
by kwaping (Priest) on Jun 18, 2007 at 17:15 UTC
    Cast my vote for "too much on one line". The solution I wrote was exactly the same as the first solution above, by ForgotPasswordAgain (lol). I'm honestly surprised that it took this far down the thread for someone to post those simple lines of code. Are we all getting too fancy for our own good...?

    ---
    It's all fine and dandy until someone has to look at the code.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://621827]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (3)
As of 2017-10-20 04:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My fridge is mostly full of:

















    Results (258 votes). Check out past polls.

    Notices?