The problem is that \s matches any type of whitespace including the newline. If you change your regex line to be:
$list =~ s/ {2}/2/g;
it should work as you intend.
In reply to Re: Perl regex. Why does this happen?
by hippo
in thread Perl regex. Why does this happen?
by $h4X4_|=73}{
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |