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)

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.

      No, int('12ihjlijlij') == 12, which is != '12ijlijlij'... uh.. or not.. Nevermind :o)