I'm trying to use Archive::Tar to extract the contents of a large number of tarballs into a given directory.
Super Search finds me lots of information on creating tarballs with this module, but I didn't really find anything on extracting the entire tarball.
Archive::Tar module review was of some help.
foreach (@sorted){
my $tar = Archive::Tar->new($_);
my @files = $tar->get_files;
foreach my $file (@files){
$tar->extract_file($file, "./EXTRACTED/$_");
}
}
This snippet of code gives me: "No such file in archive: 'Archive::Tar::File=HASH(0xa1189a4)'". Which I believe means $file is a hash ref. But I'm not sure where to go from here.
Where am I going wrong here?
Thanks,
Mike
Update: Thanks tlm & itub, list_files was the issue!