use Archive::Extract; my $ae = Archive::Extract->new( archive => 'myfile.tgz' ); my $ok = $ae->extract or die $ae->error; #### Unable to extract 'myfile.tgz': at ./data_sort.pl line 156.