in reply to Checking whether a value is numeric or not
if($blk !~ /^[\d]+$/) {print "Invalid value"}; [download]
For this particular case, I would probably use:
if($blk =~ /\D/) { print "Invalid value";} [download]
For some reason, it seems clearer to me.