in reply to Minor querry!!

Use a regex:
if( $input =~ /^(\d+)$/ ) { $a = $1; } else { print "Please enter a number\n" }
or something like that.