Your question has already been answered, but I have the feeling that you'll save yourself a lot of time if you check out
MIME::tools, or perhaps
MIME::Lite, if you haven't already. As we love to say around here, don't reinvent the wheel, use
CPAN.
MeowChow
s aamecha.s a..a\u$&owag.print