in reply to Removing underscores.

Your question is not clear.

I could say
$txt =~ s/_+//g; $txt =~ s/_+\././;
And they'd both remove the one you want gone... but react differently in other cases.