TATMWTDIThere are too many ways to do it#12

Solution #7 - rindex

sub rindex
{
    my $s = shift;
    substr($s, 0, rindex($s, ".")) =~ tr/.//d;
    return $s;
}
Copyright © 2005 Shlomi Fish