Interpolation of Variables in Replacements
$exclamation = "yeah";
$sntc = "We had fun."
$sntc =~ s/w+/$exclamation/g;
print $sntc;
# yeah yeah yeah.
# a pattern can contain a Perl variable.
Previous slide
Next slide
Back to first slide
View graphic version