in reply to Re: Rotating Log Files
in thread Rotating Log Files

Thanks to the remarks, I have added them to the snippit.. I always use strict and warnings, but left them out here since this is only a snippit

Also, using the ternary operator ?: just for his side effects is generally frowned upong, unless in golf or obfu, that is.

Which are the side-effects of this operator? I have never experienced any...

Go Fish!

Replies are listed 'Best First'.
Re^3: Rotating Log Files
by blazar (Canon) on Dec 29, 2005 at 12:49 UTC
    Which are the side-effects of this operator? I have never experienced any...

    But... you're using them, nevertheless! Generally one should use if (and else) for flow control and ?: to operate on values, e.g.

    if (something) { do 'this'; } else { do 'that'; } do (something ? 'this' : 'that');

    Of course ?: also acts like an "if-then-else" and you can use it like that. But that's what is generally considered a side effect, since you're discarding its return value which its key feature.