Perlfunc: is_number

sub is_number() {
    my $in = shift();
    if (!defined($in)) { return 0; }

    # If there are any non-number characters in it no good!
    if ($in =~ /^-?[0-9.]+$/) {
        return 1;
    } else {
        return 0;
    }
}


Note: Replies will be formatted with PHP Markdown Extra syntax.

Name: Email (Not Required):
 
Logged IP: 18.118.149.55
To prevent spam please submit by clicking the kitten: