Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: ?: = Obfuscation?

by philcrow (Priest)
on Dec 01, 2006 at 16:48 UTC ( #587233=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    if    ( $score >= 90 ) { $grade = 'A'; }
    elsif ( $score >= 80 ) { $grade = 'B'; }
    #...
    else                   { $grade = 'F'; }
    
  2. or download this
    $grade = ( $score >= 90 ) ? 'A'
           : ( $score >= 80 ) ? 'B'
           : ( $score >= 70 ) ? 'C'
           : ( $score >= 60 ) ? 'D'
           :                    'F';
    
  3. or download this
    if    ( $score >= 90 ) {
        $grade = 'A';
    ...
        $grade = 'B';
    }
    #...
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (3)
As of 2017-04-29 00:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I'm a fool:











    Results (531 votes). Check out past polls.