in reply to Duplicate Words

How about changing the it to finish like this:
@Lines = split /\W+/, $Contents; While (<@Lines>) { $Contents ~= s/$_//; }
and save the $Contents as your returning string.

This is my guess, I'm totally new to Perl.

2001-04-20 Edit by Corion : Added CODE tags