my $str = "x.z.y"; my ($first,$second) = split(/\.([^.]*)$/,$str);