$test =~ s/\n/ /g;

can you explain this is this find and replace kind of thing