my $ri = rindex($string,$word); substr($string,$ri,length($word)) = '' if $ri > -1;