See the documentation of s///:
If the pattern evaluates to the empty string, the last successfully executed regular expression is used instead. See perlre for further explanation on these.
In your code, s///r has the empty pattern in it.
In reply to Re: no way it's not a bug of Perl
by Corion
in thread I thought I found a bug of Perl
by vincentaxhe
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |