Beefy Boxes and Bandwidth Generously Provided by pair Networks Bob
The stupid question is the question not asked
 
PerlMonks  

Re^3: Two simple code style advice questions

by choroba (Abbot)
on Jan 16, 2013 at 14:12 UTC ( #1013579=note: print w/ replies, xml ) Need Help??


in reply to Re^2: Two simple code style advice questions
in thread Two simple code style advice questions

It probably means "Using '... x condition' is not always safe":

say $_ ? "true" : "false", "a" x $_ for 0, 1, "0e0";
لսႽ ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ


Comment on Re^3: Two simple code style advice questions
Select or Download Code
Re^4: Two simple code style advice questions
by Anonymous Monk on Jan 16, 2013 at 14:20 UTC
    Now what do you mean by that? What is it that you expect and how is it unsafe?

      The issue is that the code relies on true being represented by numeric one. While that works for numeric comparisons, it is not a safe assumption in general. So applying this construct to other kinds of tests could be dangerous.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (11)
As of 2014-04-21 15:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (495 votes), past polls