Re: not sure why I am getting the following warning "Useless use of a constant in void context"



On 2007-12-14 20:44, John W. Krahn <krahnj@xxxxxxxxx> wrote:
"mcardeiro@xxxxxxxxx" wrote:
On Dec 14, 12:40 pm, "John W. Krahn" <kra...@xxxxxxxxx> wrote:
Just because it "works", for some value of "works", does not mean it is
the correct way to do it.

what exactly is incorrect about saying run a subroutine and assign the
return to a variable or exit?

I was commenting on the use of '||' instead of 'or' for flow control.
That the subroutine in question uses 'exit()' is just a side effect.
You shouldn't rely on side effects for flow control.

You are doing the same thing with or. It just happens at a slightly
different point in the program.

hp
.



Relevant Pages