J
Julia deSilva
Hi there all,
I sure this is really obvious but what's the syntax for this please:
my $string1 = "mark had a little dog";
$string1 =~ s/dog/lamb/g; # $string1 is "mary had a little lamb"
But ................
my $string1 = "mark had a little dog";
my $string2 = $string1 =~ s/dog/lamb/g;
This returns
$string2 = 1 (presumably a boolean for substitute done)
whereas I want it to return $string2 = "mary had a little lamb";
Thanks in advance
I sure this is really obvious but what's the syntax for this please:
my $string1 = "mark had a little dog";
$string1 =~ s/dog/lamb/g; # $string1 is "mary had a little lamb"
But ................
my $string1 = "mark had a little dog";
my $string2 = $string1 =~ s/dog/lamb/g;
This returns
$string2 = 1 (presumably a boolean for substitute done)
whereas I want it to return $string2 = "mary had a little lamb";
Thanks in advance