use Archive::Zip qw( :ERROR_CODES ); my $testsArchive = "master.zip"; my $testsDirectory = "master/"; my $zip = Archive::Zip->new(); die 'read error' unless ( $zip->read( $testsArchive ) == AZ_OK ); $zip->extractTree( '', $testsDirectory );