How to replace the charactors in the string?

To be convenient for test, the Perl script attached here.

#!/usr/bin/perl
use strict;
use warnings;

my $i=100000;
my $start=times;
while ($i>1) {
my $string = ‘The cat sat on the mat’;
$string =~ tr/ao/oL/;
print “$string\n”;
$i–;
}
print times-$start," seconds\n";