in reply to Re: Re: Re: variable set to 0 ? 0 : 1
in thread variable set to 0 ? 0 : 1

Apart from the fact that it gives

Argument "fred" isn't numeric in numeric ne (!=) line 1 0

with -w, which admittedly the original did too.

The result of ($status!=0) will always be either 0 or 1 won't it?

In which case, the 0+ isn't doing anything? In fact neither then are the () nor the return?

I get the distinct feeling I'm walking into the trap here, but I cannot see it.


Well It's better than the Abottoire, but Yorkshire!

Replies are listed 'Best First'.
Re: Re: Re: Re: Re: variable set to 0 ? 0 : 1
by sauoq (Abbot) on Sep 07, 2002 at 04:25 UTC
    The result of ($status!=0) will always be either 0 or 1 won't it?

    It will either be 1 or "" (the empty string.) All of the comparison operators work this way with the obvious exceptions of <=> and cmp. So do logical negation and most of the file test operators.

    I get the distinct feeling I'm walking into the trap here, but I cannot see it.

    Well, it wasn't really meant to be a trap but, yes, you walked into it. :-)

    -sauoq
    "My two cents aren't worth a dime.";