See binmode.
In reply to Re^3: Help: Mime decoding of a large file by almut in thread Help: Mime decoding of a large file by jujiro_eb