Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options

Re: Conditional Interpretation?

by gryphon (Abbot)
on Feb 01, 2006 at 03:06 UTC ( #526950=note: print w/replies, xml ) Need Help??

in reply to Conditional Interpretation?

Greetings earcam,

One of the things we did was to use a constant (or a bitwise and set of constants) inside a right-side if conditional for whether we had debug statements work. The compiler optimizes away the entire line at run-time if the constant conditional is false.

do_something() if ($CONSTANT); do_something_else() if ($CONSTANT & $ANOTHER_CONSTANT);

Is this what you're looking for?

gryphon Development Manager (WDDC)
code('Perl') || die;

Replies are listed 'Best First'.
Re^2: Conditional Interpretation?
by ikegami (Pope) on Feb 01, 2006 at 03:14 UTC

    Constants don't have leading dollar signs.

    do_something() if (CONSTANT); do_something_else() if (CONSTANT & ANOTHER_CONSTANT);

    If there's a dollar sign, it's not a constant, and Perl won't optimize it away.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://526950]
[kcott]: marioroy, thanks also.
[marioroy]: kcott some time ago, somebody posted about slow logging. I forgot the post. I believed you had replied to it.
[marioroy]: ... among many workers. Somebody had ask how.
[marioroy]: It's not this thread Re^4: Mahalo - Thank you in Hawaii. Someone before had asked before about slow performance.

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (6)
As of 2017-08-18 08:40 GMT
Find Nodes?
    Voting Booth?
    Who is your favorite scientist and why?

    Results (297 votes). Check out past polls.