in reply to Perl regex. Why does this happen?
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; [download]
it should work as you intend.