Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re^2: parentheses around a function call in a ternary choice

by didess (Sexton)
on Jun 23, 2009 at 21:20 UTC ( [id://774181]=note: print w/replies, xml ) Need Help??


in reply to Re: parentheses around a function call in a ternary choice
in thread parentheses around a function call in a ternary choice

To be very honest, the warnings coming when using "warnings"

do not explain very much to me !

(which constants are we warned about ?)

But your explanations do explain all clearly!

Thanks to all

  • Comment on Re^2: parentheses around a function call in a ternary choice

Replies are listed 'Best First'.
Re^3: parentheses around a function call in a ternary choice
by FunkyMonk (Chancellor) on Jun 23, 2009 at 21:40 UTC
    a successful print returns true (see print). So your prints are equivalent to

    1 ? "3: Flag is up\n" : "3: Flag is not up\n";

    and that's a constant expression that evaluates to

    "3: Flag is up\n";

    That's a constant that isn't used for anything -- a constant in void context.

    When you get errors or warnings you don't understand try adding use diagnostics;. It will try to explain the error or warning given.


    Unless I state otherwise, all my code runs with strict and warnings

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (3)
As of 2024-04-25 08:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found