Think about Loose Coupling | |
PerlMonks |
Re: Is a integer or string.by irah (Pilgrim) |
on May 25, 2009 at 10:36 UTC ( [id://766007]=note: print w/replies, xml ) | Need Help?? |
There is no difference in Perl scalar variable in case of string and integer. If the value of the variable have only numbers, it treat as integer and it required "==" for comparison. If any alphabets available in variable, it treat as, string. Is there any case where it fails?In all places, the second condition will work. From perlintro man page, Scalar values can be strings, integers or floating point numbers, and Perl will automatically convert between them as required.
In Section
Seekers of Perl Wisdom
|
|