Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Is this reliable?

by blue_cowdawg (Monsignor)
on Feb 18, 2013 at 16:41 UTC ( #1019362=note: print w/ replies, xml ) Need Help??


in reply to Is this reliable?

      But what I wonder (and have my doubts about) is, will this appoach also work on a arbitrary Perl/OS implementation? My doubt is that

As far as I know the results of a comparative will always evaluate as a non-zero if true. That said I'd be more comfortable doing things this way:

my $r = (temp> 100? 1000: 1250);
That should eliminate any doubt of the matter.


Peter L. Berghold -- Unix Professional
Peter -at- Berghold -dot- Net; AOL IM redcowdawg Yahoo IM: blue_cowdawg


Comment on Re: Is this reliable?
Download Code
Replies are listed 'Best First'.
Re^2: Is this reliable?
by AnomalousMonk (Abbot) on Feb 18, 2013 at 16:59 UTC

    Or even
        $r += ($temp > 100 ? 250 : 0);
    or
        $temp > 100 and $r += 250;

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (11)
As of 2015-07-28 11:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (254 votes), past polls