TATMWTDI There are too many ways to do it #9

Solution #4 - With Look Ahead

sub look_ahead
{
    my $s = shift;
    $s =~ s/\.(?=.*\.)//g;
    return $s;
}
Copyright © 2005 Shlomi Fish