Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Re: Re: Can you guess the result? Is it a bug?

by dga (Hermit)
on Jul 31, 2003 at 22:06 UTC ( [id://279809]=note: print w/replies, xml ) Need Help??


in reply to Re: Re: Can you guess the result? Is it a bug?
in thread Can you guess the result? Is it a bug?

The warning is just trying to help you out so that you don't have an if that evaluates to a constant boolean value which these all do. Consider:

... if($val == 3); #versus ... if($val = 3);

In the first is checks to see if $val is 3 and in the second it sets $val to be 3 and then checks $val for truth which in this case is always true. So for normal situations that line should just be:

...; $val=3;

Which would have the same effect in my little sample program.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (5)
As of 2024-03-28 10:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found