Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Re: Re: Re: variable set to 0 ? 0 : 1

by BrowserUk (Patriarch)
on Sep 07, 2002 at 02:08 UTC ( [id://195823]=note: print w/replies, xml ) Need Help??


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.";
    

Log In?
Username:
Password:

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

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

    No recent polls found