http://www.perlmonks.org?node_id=940400


in reply to Perl adding non printable characters in the return value

...and a Perl subroutine is defined with sub, but maybe your code is just a typo (looks like old ksh syntax).
Anyway, one possibility might be that in one place you put the string inside quotes (interpolation) and the class is overloading stringification (see overload). You don't show that, but then again this obviously is not the whole code anyway.