pmarcoen has asked for the wisdom of the Perl Monks concerning the following question:
The output for this is:use strict; use warnings; if("test" == 0){ print "in if"; } else { print "in else"; }
It seems to me that if a statement is wrong, it should not evaluate to true, what am I missing here ?Argument "test" isn't numeric in numeric eq (==) at D:/eclipse/workspa +ce/Tests/shorthand_if/stupid_problem.pl line 4. in if
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Why is this evaluating to true?
by lidden (Curate) on Nov 16, 2011 at 13:04 UTC | |
by SuicideJunkie (Vicar) on Nov 16, 2011 at 14:20 UTC | |
by pmarcoen (Novice) on Nov 16, 2011 at 13:11 UTC | |
|
Re: Why is this evaluating to true?
by roboticus (Chancellor) on Nov 16, 2011 at 13:24 UTC | |
|
Re: Why is this evaluating to true?
by JavaFan (Canon) on Nov 16, 2011 at 18:33 UTC | |
|
Re: Why is this evaluating to true?
by davido (Cardinal) on Nov 16, 2011 at 17:27 UTC | |
|
Re: Why is this evaluating to true?
by pvaldes (Chaplain) on Nov 16, 2011 at 22:21 UTC |