binmode STDOUT, ':crlf'; $top->print(\*STDOUT); # or open MIME, '>', $fname; binmode MIME, ':crlf'; $top->print(\*MIME);