perl replace substring code example
Example: perl replace substring
# For Perl (language) only
# syntax (NOTE: this overwrites your original string)
=~ s///g;
# example: replacing all the 'r' characters with 'l'
$YourVar =~ s/r/l/g;
# usable example
my $YourVar = "strawberry";
$YourVar =~ s/r/l/g;
print $YourVar;
print "\n";