use strict;
my $str = 'nospmiS maC retroper lanruoJ teertS llaW edulcni repapswen eht fo inmula elbatoN lmths .7665401-09.snruT .sweN-ehT/sweN/40/11/5002/swen/903repap/egarots/aidem/moc .swenned .www .aidem//:ptth .0891 ni nesohc saw eman tnerruc sti erofeb sweN etatS nretsaE dna sweN egelloC s\'rehcaeT demaner saw repap ehT .repapswen yliad a evah ot yrtnuoc eht ni seitisrevinu tsellams eht fo eno si dna 2999031 .1-sserp-lles-ot-setov-draob-aidem-tneduts/seirots-pot/moc .enilnonaxetyliad .www//:ptth sserp gnitnirp repapswen nwo sti nur ot setatS detinU eht ni seitisrevinu eerht ylno fo eno si ytisrevinU sionillI nretsaE';
my $regex = qr/(?=[a-zA-Z0-9\/ \.\-]+\/\/:ptth) \./mp;
my $subst = '.';
my $result = $str =~ s/$regex/$subst/rg;
print "The result of the substitution is' $result\n";
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for Perl, please visit: http://perldoc.perl.org/perlre.html