How about:
use utf8;
my $str = "ভাৰত is a famous country. দিল্লী is the capital of ভাৰত";
$str =~ s/([\x{0980}-\x{09FF}])(?=[\x{0980}-\x{09FF}])/$1 /g;
say $str;
output:
ভ া ৰ ত is a famous country. দ ি ল ্ ল ী is the capital of ভ া ৰ ত
You can use it in your program, just change the while loop to:
while(<>) {
s/([\x{0980}-\x{09FF}])(?=[\x{0980}-\x{09FF}])/$1 /g;
print $_;
}
But I think you whish to do:
my %corresp = (
'ভ' => 'Bh',
'া' => 'a',
'ৰ' => 'ra',
'ত' => 't',
);
my $str = "ভাৰত is a famous country. দিল্লী is the capital of ভাৰত";
$str =~ s/([\x{0980}-\x{09FF}])/exists($corresp{$1}) ? $corresp{$1} : $1/eg;
say $str;
Output:
Bharat is a famous country. দিল্লী is the capital of Bharat
NB: It's up to you to build the true corresponding hash. I don't know anything about Assamese characters.