in reply to Re^2: Help: Mime decoding of a large file
in thread Help: Mime decoding of a large file

Read: perldoc -f binmode

Oversimplified explanation: Win will puke trying to cope with binary data unless suitably instructed (binmode) that said data includes (most) non-ASCII chars.

Replies are listed 'Best First'.
Re^4: Help: Mime decoding of a large file
by jujiro_eb (Sexton) on Apr 16, 2009 at 13:13 UTC
    Thanks guys.

    Binmode did fix my encoding issue of a PDF file. However, Binmode does not do anything while decoding it. Decoded file is still corrupted.

    Directory of c:\

    04/13/2009 06:54 PM 7,171,180 O.pdf (Original file))
    04/16/2009 09:08 AM 7,518,867 a.mimed.pdf (Decoded file with binmode)
    04/16/2009 09:00 AM 7,518,867 a.pdf (Decoded file without binmode)

    Ash

      I suspect you're using binmode with FILE as argument. Considering you original post you should use

      binmode STDOUT;
        Thank you so much zwon! That was it. I took the stdout part out completely and now I am printing to a file directly rather than redirection from stdout.

        Thanks again.

        Ash