in reply to Minor querry!!

Another way:
if ($a eq $a+0) { #$a is a decimal number }
This won't work if you were planning on accepting input numbers in hex or octal though, only decimal.