my ( $int, $rest ) = split /\./, $number, 2; $int = 0 if !defined $int || length $int == 0; $rest = 0 if !defined $rest || length $rest == 0;