Published
- 1 min read
search and replace in perl
The solution for this is noted below
search and replace in perl
Solution
#!/usr/bin/perl
$string = "The cat sat on the mat";
$string =~ s/cat/dog/gc;
print "$string\n";
Try other methods by searching on the site. That is if this doesn’t work