Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Question about ternary condition

by robartes (Priest)
on Jun 28, 2005 at 09:45 UTC ( #470546=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    Y:\tmp>perl -MO=Deparse,-p 470538.pl
    (my(%hash) = ('A', 'on', 'B', 'on', 'C', 'off', 'D', 'off', 'E', 'off'
    +));
    ...
        print($result, "\n");
    }
    470538.pl syntax OK
    
  2. or download this
       (exists $hash{$_} and $hash{$_} eq 'on') 
          ? ($result = 'OK') 
          : ($result = 'KO');
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://470546]
help
Chatterbox?
[Discipulus]: beer finished in Strasbourg? ;=)
[Corion]: Discipulus: Yeah, or it got too warm and they hope for colder beer here ;)

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (7)
As of 2018-07-23 08:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    It has been suggested to rename Perl 6 in order to boost its marketing potential. Which name would you prefer?















    Results (459 votes). Check out past polls.

    Notices?