warn "has nondigits" if /\D/; warn "not a whole number" unless /^\d+$/; warn "not an integer" unless /^[+-]?\d+$/ warn "not a decimal number" unless /^[+-]?\d+\.?\d*$/ warn "not a C float" unless /^([+-]?)(?=\d|\.\d)\d*(\.\d*)?([Ee]([+-]?\d+))?$/;
Or you could check out CPAN/modules/by-module/String/String-Scanf-1.1.tar.gz instead.