in reply to
Is a integer or string.
I usually just do an if ($n == int($n)) to check for numberness. Maybe there's a better way, I dunno... (obviously this doesn't work with floats)
Comment on
Re: Is a integer or string.
Replies are listed 'Best First'.
Re^2: Is a integer or string.
by
akho
(Hermit)
on May 25, 2009 at 14:47 UTC
perl -e "print 'You should not.' if ('12ijlijlij' == int('12ihjlijlij'))"
eq
would work, however.
[reply]
[d/l]
[select]
Re^3: Is a integer or string.
by
FloydATC
(Deacon)
on May 25, 2009 at 14:56 UTC
No, int('12ihjlijlij') == 12, which is != '12ijlijlij'... uh.. or not.. Nevermind :o)
[reply]
In Section
Seekers of Perl Wisdom