Trying to use Archive::Tar.
My perl code lives in one path and, given the need to maintain some consistency and structure, I don't want to have to execute that code in the source directory of the files to be bundled into the archive which is in a totally different tree.
My code...
$tar->setcwd($vsvroot);
foreach my $vsvxdb (<cntl/*>) {
$tar->add_files($vsvxdb);
}
$tar->write("$vsvroot/tmp/cntlbkup.tar");
The file $vsvroot/tmp/cntlbkup.tar is created but empty.
The problem appears to be that the "foreach $vsvxdb" is trying to find "cntl/*" in the perl code's directory.
I have tried using $tar->cwd($vsvroot); as well.