1#!/bin/perl -w 2# Extracts all files from the given zip 3# $Revision: 1.3 $ 4# usage: 5# perl unzipAll.pl [-j] zipfile.zip 6# if -j option given, discards paths. 7# 8use strict; 9 10use vars qw( $opt_j ); 11use Archive::Zip qw(:ERROR_CODES); 12use Getopt::Std; 13 14$opt_j = 0; 15getopts('j'); 16 17if (@ARGV < 1) { 18 die <<EOF 19 usage: perl $0 [-j] zipfile.zip 20 if -j option given, discards paths. 21EOF 22} 23 24my $zip = Archive::Zip->new(); 25my $zipName = shift(@ARGV); 26my $status = $zip->read($zipName); 27die "Read of $zipName failed\n" if $status != AZ_OK; 28 29$zip->extractTree(); 30