in reply to Splitting up Archive::Tar $tar object
paste this into temp.pl
then runuse Archive::Tar; use strict; my $parent = Archive::Tar->new("parent.tar"); my $child_tar = Archive::Tar->new(); $child_tar->add_data("file1",$parent->get_content("file1")); $child_tar->add_data("file2",$parent->get_content("file2")); $child_tar->write("child1.tar"); $parent->remove("file1"); $parent->remove("file2"); $parent->write("child2.tar");
$ echo "contents of file1">file1 $ echo "contents of file2">file2 $ echo "contents of file3">file3 $ echo "contents of file4">file4 $ tar cf parent.tar file? $ rm -f file? $ perl temp.pl $ tar xfv child1.tar file1 file2 $ cat file? contents of file1 contents of file2 $ tar xfv child2.tar file3 file4 $ cat file? contents of file1 contents of file2 contents of file3 contents of file4
--
flounder
|
|---|