Archive::Tar is a Perl module for manipulations of tar archives.
my $tar = Archive::Tar->new;
$tar->add_data('file/baz.txt', 'This is the contents now');
Archive::Tar provides an object oriented mechanism for handling tar files. It provides class methods for quick and easy files handling while also allowing for the creation of tar file objects for custom manipulation. If you have the IO::Zlib module installed, Archive::Tar will also support compressed or gzipped tar files.
An object of class Archive::Tar represents a .tar(.gz) archive full of files and things.