[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[no subject]



    Christopher> I'm trying to use MIME::Base64::encode to encode a 9m
    Christopher> binary file into Base64.  I'm using sysopen and
    Christopher> sysread on the file but I'm not sure how to append
    Christopher> the result of the read into a data buffer.

If you check down in the "EXAMPLES" section of "perldoc MIME::Base64"
it says you should just read and encode using a multiple of 57 bytes
to completely fill up a single base64 line:

          use MIME::Base64 qw(encode_base64);

          open(FILE, "/var/log/wtmp") or die "$!";
          while (read(FILE, $buf, 60*57)) {
              print encode_base64($buf);
          }

-- 
Fletch                | "If you find my answers frightening,       __`'/|
fletch at phydeaux.org|  Vincent, you should cease askin'          \ o.O'
                      |  scary questions." -- Jules                =(___)=
                      |                                               U


</pre>
<!--X-Body-of-Message-End-->
<!--X-MsgBody-End-->
<!--X-Follow-Ups-->
<hr>
<ul><li><strong>Follow-Ups</strong>:
<ul>
<li><strong><a name="00528" href="msg00528.html">[ale] Base64 encoding in Perl</a></strong>
<ul><li><em>From:</em> cfowler at outpostsentinel.com (Christopher Fowler)</li></ul></li>
</ul></li></ul>
<!--X-Follow-Ups-End-->
<!--X-References-->
<ul><li><strong>References</strong>:
<ul>
<li><strong><a name="00524" href="msg00524.html">[ale] Base64 encoding in Perl</a></strong>
<ul><li><em>From:</em> cfowler at outpostsentinel.com (Christopher Fowler)</li></ul></li>
</ul></li></ul>
<!--X-References-End-->
<!--X-BotPNI-->
<ul>
<li>Prev by Date:
<strong><a href="msg00525.html">[ale] Re: speedfactory dsl router setup</a></strong>
</li>
<li>Next by Date:
<strong><a href="msg00527.html">[ale] Re: speedfactory dsl router setup</a></strong>
</li>
<li>Previous by thread:
<strong><a href="msg00524.html">[ale] Base64 encoding in Perl</a></strong>
</li>
<li>Next by thread:
<strong><a href="msg00528.html">[ale] Base64 encoding in Perl</a></strong>
</li>
<li>Index(es):
<ul>
<li><a href="maillist.html#00526"><strong>Date</strong></a></li>
<li><a href="threads.html#00526"><strong>Thread</strong></a></li>
</ul>
</li>
</ul>

<!--X-BotPNI-End-->
<!--X-User-Footer-->
<!--X-User-Footer-End-->
</body>
</html>