perlquestion
salva
Well, at least, it has surprised me:
<c>
my $out = "hello\nfoo" =~ s/o*$/O/gmr;
say $out
</c>
<spoiler>
<c>
hellOO
fOO
</c>
What is happening is that the regular expression matches the <c>o</c> at the end of the line, replaces it and then it matches the empty space at the end of the line and replaces it again.
<p>But that's not what I would expect. I think that once <c>$</c> is matched, Perl should continue matching in the next line.
<p>What's your opinion?
</spoiler>