There's more than one way to do things | |
PerlMonks |
Re: confused: string and number comparisonby lostjimmy (Chaplain) |
on Mar 23, 2011 at 14:35 UTC ( [id://895008]=note: print w/replies, xml ) | Need Help?? |
Why not just do a string equality comparison for both? You won't have the warning, and comparing '0' to 0 will give you the desired outcome.
Update: Just checking the value's truthiness should also suffice.
In Section
Seekers of Perl Wisdom
|
|