In Perl, the concatenation operator is a dot (.), not a plus (+). In your code, Perl is trying to do a sum, maybe causing the garbled output. Try using a dot and see if it works.
Comment on Re: Perl adding non printable characters in the return value