use strict; use warnings; my ($a, $b) = (301 / 60) =~ m/^([^\.]+)\.?([^\.]*)$/; print "$a\t$b\n";