sub my_float { my $num = shift; return 0 if (!defined $num || $num =~/[^ \d\-\+.]/); return $num; } [download]
In reply to Filter "Nan" from user input by Anonymous Monk