use MIME::QuotedPrint; #### print tomail "$line\n"; #### $decoded = MIME::QuotedPrint::decode($line); print tomail "$decoded";