sub my_float { my $num = shift; return 0 if (!defined $num || $num =~/[^ \d\-\+.]/); return $num; }