It should work just fine to decode the file line by line.  "Proof":

#!/usr/bin/perl use MIME::Base64 (); my $file_name = shift @ARGV; my $buf; open my $fh_in, "<", $file_name or die $!; open my $fh_out, ">", $file_name.".base64" or die $!; while (read($fh_in, $buf, 100*57)) { print $fh_out MIME::Base64::encode($buf); } close $fh_out; open my $fh_base64, "<", $file_name.".base64" or die $!; open my $fh_decoded, ">", $file_name.".decoded" or die $!; while ($buf = <$fh_base64>) { print $fh_decoded MIME::Base64::decode($buf); } __END__ $ ./757820.pl hugefile $ ls -l hugefile* -rw-r--r-- 1 almut almut 618119168 2009-02-07 02:01 hugefile -rw-r--r-- 1 almut almut 835003088 2009-04-16 04:51 hugefile.base64 -rw-r--r-- 1 almut almut 618119168 2009-04-16 04:51 hugefile.decoded $ cmp hugefile hugefile.decoded $

Do you maybe have some junk around the actual base64 data section in your encoded file, or is it maybe additionally transfer-encoded one way or another (e.g. quoted-printable)?


In reply to Re: Help: Mime decoding of a large file by almut
in thread Help: Mime decoding of a large file by jujiro_eb

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.