good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Dear Perl Monks Perl handles the bitwise operators on integers and strings differently. E.g. "2"|"8" = ":" (bitwise ascii) while 2|10 = 12. So there are places in perl, where it makes a difference if a scalar is a string or an integer. Yet there doesn't seem to be a way to find out if a scalar is an integer or string. All the references I found go back to a regexp match, but this way I cannot distinguish between an integer and a string. Is there a way? And yes, I know how to force a string to an integer using int(). Best regards, Michael In reply to "2" | "8" = ":" and 2|8=10 by MSoegtropIMC
|
|