I need to automate some stuff and decided to use perl.

I have cygwin perl and activestate perl.

Below is my attempt. It does not work because I don't have perlIO::gzip 
installed.

When I tried

/bin/Perl -MCPAN -e 'install PerlIO::gzip'

The tests fail and it won't install.

When I try activestate perl's ppm.bat I don't see an any modules when I search 
for gzip (except for one called CGI-WebGzip which did not look like what I 
wanted).

Can someone help me reinvent "tar xvfz"?

Thanks!
Siegfried

#!c:/perl/bin/perl

#
# $Log$
#
# Begin commands to execute this file using Perl with bash
# ./untar.pl ..\\Archive-Tar-1.38.tar.gz >..\\Archive-Tar-1.38.tar
# End commands to execute this file using Perl with bash
#

use strict;
use warnings;
use Archive::Tar;
use PerlIO::gzip;
my $zipName = shift(@ARGV);
open FOO, "<:gzip", $zipName or die $!;
print while <FOO>; # And it will be uncompressed...
close FOO;
$zipName = "..\\Archive-Tar-1.38.tar";
my $tar = Archive::Tar->new;
print "untar $zipName\n";
$tar->read($zipName,1);
$tar->extract();

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to