in reply to using Archive::Tar

use strict; use warnings; use autodie; use Archive::Tar; my @filelist = (); opendir(my $dir, '/path/to/my/dir/'); while(readdir $dir) { chomp; if (!~ /(^\.\.|\.)$/){ push @filelist, $_; } } my $pack = Archive::Tar->new; $pack->create_archive('Bundle-FinalTest.tgz', COMPRESS_GZIP, @filelist +); closedir $dir;

UPDATE: A couple of changes, but Not properly working still...

a lot of "not such file: filename" error messages, I don't know why

Alternatively, you can use the old cheap way, that is guaranteed to act as you expect:

`tar -zcvvf Bundle-FinalTest.tgz /path/to/Bundle/FinalTest/dir/`;

Replies are listed 'Best First'.
Re^2: using Archive::Tar
by Tux (Canon) on Oct 04, 2011 at 14:45 UTC

    Combine with File::Find:

    use strict; use warnings; use autodie; use Archive::Tar; use File::Find; my @fl; find (sub { -d $_ or push @fl, $File::Find::name }, "Bundle::Finaltest +"); Archive::Tar->create_archive ("Bundle-FinalTest.tar.gz", COMPRESS_GZIP +, @fl);

    Enjoy, Have FUN! H.Merijn
      thanks H.Merijin i have used your code
    A reply falls below the community's threshold of quality. You may see it by logging in.