Thanks for the reference.
if (/^-?\d+\.?\d*$/) { print "is a real number\n" }
also appears to do what I want. Unfortunately the only reference I checked was the Perl Cookbook, which contains the same expression, but with a slightly vague comment:
warn "not a decimal number" unless (/^-?\d+\.?\d*$/); #rejects .2
At the time it looked as if it wouldn't suit my needs. Upon closer examination, which I only had time for thanks to tadman and VSarkiss, I wouldn't really care to receive any value less than one, but I planned to replace any unacceptable values with zero anyhow.
--Jim | [reply] [d/l] [select] |