4 lines
144 B
Perl
4 lines
144 B
Perl
$string = "I am a string";
|
|
if ($string =~ s/\bam\b/was/) { # \b is a word border
|
|
print "I was able to find and replace 'am' with 'was'\n";
|
|
}
|