in reply to If condition logic yielding partially correct output
Hi PerlMonks, Seeking you assistance for the following :
First some wisdom, Use strict warnings and diagnostics or die,
Now to your code, oops, more wisdom :) read perlnumber
A string, used in numeric operation, is converted to a number, most often 0. You want to use ne. See also defined and length.warn 'test' ne 0; warn 'test' == 0; warn 'test' != 0; warn 'test' + 0; __END__ 1 at - line 1. 1 at - line 2. Warning: something's wrong at - line 3. 0 at - line 4.
|
|---|