I'm using a Perl script to modify some files inside a .tar, and the directory structure inside the resulting .tar disappears. Eliminating more and more code I've come as far as all that's required to reproduce this is
my $data_tar = Archive::Tar->new('data.tar');
$data_tar->write('modified_data.tar');
Both .tar-files have all the files, however the indication of what directories the files and subdirectories were located in are lost.
I've looked through the docs and src for Archive::Tar but I really don't understand what's going on.
I'm using perl 5.10.0 on win32, tar 1.12 and Archive::Tar 1.54. I examined the .tar-files in an editor and the data.tar contains dir/ and dir/file.txt, but in the modified_data.tar they show up as dir and file.txt so my original tar seems ok.
Anyone of you that have seen this before or have any ideas?