in reply to Re^2: Problem in sending "tar" files as attachment using MIME::Lite module
in thread Problem in sending "tar" files as attachment using MIME::Lite module

You could try opening the output file first, using PerlIO::gzip so that it gets compressed on output, then pass the file handle to Archive::Tar->write() -- something like this:
use PerlIO::gzip; use Archive::tar; # ... open( my $tarfh, ">:gzip", "my_tarball.tar.gz" ); # ... $tar->write( $tarfh );
(I haven't tried that myself, but that's what I would try.)

UPDATE: (2010-10-18) It seems that PerlIO::gzip should be viewed as superseded by PerlIO::via:gzip. (see PerlIO::gzip or PerlIO::via::gzip).

  • Comment on Re^3: Problem in sending "tar" files as attachment using MIME::Lite module
  • Download Code