Используйте осмотр вокруг:
$sen =~ s/(?<!\d)\.(?!\d)//g;
Это будет соответствовать точке, которой не предшествует цифра и за которой не следует цифра.
Обновленная в соответствии с комментарием ОП, это удалит точки, которыесопровождаются заглавными буквами:
#!/usr/bin/perl
use Modern::Perl;
use utf8;
while(<DATA>) {
chomp;
s/\.(?=(?:\s*[A-Z])|$)//g;
# Or, if you want to be unicode compatible
s/\pP(?=(?:\s*\p{Lu})|$)//g;
say;
}
__DATA__
I'm going to match full.stop in sentence 3.142
I'm going to match full.Stop in sentence 3.142
I'm going to match full. Stop in sentence 3.142
I'm going to match full.stop in sentence 3.142. End of string.
вывод:
I'm going to match full.stop in sentence 3.142
I'm going to match fullStop in sentence 3.142
I'm going to match full Stop in sentence 3.142
I'm going to match full.stop in sentence 3.142 End of string