in reply to the end of a word

I'm afraid you'll have to provide a better explanation for "subtract or actually clean the end of a word". One solution (which may not fit, depending upon your needs), would be to use a word boundary (\b) with a regex.

$ perl -e '($_)="foobar]"=~/(f.*?)\b/;print' foobar

Cheers,
Ovid

Join the Perlmonks Setiathome Group or just click on the the link and check out our stats.