Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re^2: Two simple code style advice questions (tye)

by BrowserUk (Pope)
on Jan 18, 2013 at 05:23 UTC ( #1013953=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my $mol = ( $n == 42 ) ? 'forty two' : '';
    
  2. or download this
    my $mol = '';
     $mol = 'forty two'
         if  42 == $n;
    
  3. or download this
    my $mol =  defined $n ? ( $n == 42 ? 'fourty two' : '' ) : 'n/a';
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (6)
As of 2014-07-13 22:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (252 votes), past polls