in reply to Removing dots

If it's just the base name you need to manipulate (i.e. leave the '.txt. intact), can take advantage of File::Basename to parse that section for you, then do what you want with it. That way the regex is simple because it doesn't have to deal w/the exception of the extension.
# given: $fullname, @suffixlist (see pod for latter) use File::Basename; my ($name,$path,$suffix) = fileparse($fullname,@suffixlist); $name =~ s/\.//g; my $new_fullname = $path . $name . $suffix;