http://qs321.pair.com?node_id=1079284

dracos has asked for the wisdom of the Perl Monks concerning the following question:

Okay, I assume I am missing something if I run the following:

use strict; use warnings; use Archive::Tar; use File::Find; my @files; my $pwd = 'C:\Source Code'; find( sub { if ( $File::Find::name !~ /\.svn/i) { push @files, $File::Find::name; } }, $pwd ); Archive::Tar->create_archive( 'Test.tbz', COMPRESS_BZIP, @files ); my $tar = Archive::Tar->new; $tar->write('Test2.tbz', COMPRESS_BZIP); $tar->add_files(@files);

The Test.tbz file is created fine with no issues and ends up about 92M.

But when it comes to the Test2.tbz file, I can watch it grow as it should but then before the $tar->add_files(@files); returns the output file shrinks and ends up only about 1k.

I can not figure out what is going wrong I have tried going through the Archive::Tar to try figuring out what I should be doing. But I am getting no where