RosettaCodeData/Task/Regular-expressions/Perl/regular-expressions-2.pl

4 lines
122 B
Perl
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
$string = "I am a string";
$string =~ s/ a / another /; # makes "I am a string" into "I am another string"
print $string;