- or download this
sub atoi {
my $t;
...
}
}
$number = atoi("123");
- or download this
$string = sprintf("%f", 123.45);
- or download this
if ($string == "$string") {
# It is a number
}
- or download this
if ($var =~ /(?=.)M{0,3}(C[MD]|D?C{0,3})(X[CL]|L?X{0,3})(I[XV]|V?I{0
+,3})/) {
print "$var contains a number.\b";
}