I tested this snippet locally without modification, other than substituting my email address and adding use strict/warnings/MIME::Lite.
I succesfully tested sending a mail with a tar file created by both my native tar binary and Archive::Tar. Both mails were received, and untarring the file on the other end worked fine.
The only failure I encountered was when I did not add any files to the newfile.tar. A file created with this:
perl -MArchive::Tar -e '$t = Archive::Tar->new(); $t->write("newfile.t
+ar")'
Yielded the following when reading the file with tar -tf:
tar: Cannot identify format. Searching...
tar: End of archive volume 1 reached
tar: Sorry, unable to determine archive format.
These tests were performed on OpenBSD 3.5, perl 5.8.2, Archive::Tar 1.10, MIME::Lite 3.01. Mails were read with mutt and gmail.
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|