in reply to Re^2: help with Archive::tar
in thread help with Archive::tar
Here is the example that I could find from my tar program for extracting:
sub untar{ my $tar=Archive::Tar->new; @_ = glob ('*'); foreach my $otar(@_){ next unless($otar =~ /(\.tar)$/i); $tar->read($otar,1); my @contents = $tar->get_files(); foreach(@contents){ $tar->extract($_->{name}); print "$tar-error\n"; sleep 60; if($tar->error !~ //){ print "$_->{name} extracted\n"; }else{ print "Error extracting $_->{name} from $otar\n"; } } undef $tar; } }
|
|---|