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: 34.237.124.210
To prevent spam please submit by clicking the kitten: