[LA.pm] calling gzip from within perl

eric richardson e at ericrichardson.com
Wed Jun 29 12:39:18 PDT 2005


* Jeremy Leader (jleader at alumni.caltech.edu) wrote:
> Peter Benjamin wrote:
> > At 10:21 PM 6/28/2005, David Heayn wrote:
> >>       open(FILE, "gunzip $fileLoc |") or die "Cannot gunzip '$fileLoc': $!";
> >>       my @stuff = <FILE>;
> >>       close(FILE);

Jumping late into the discussion and replying to the wrong message...
That gzip call should be something like "gzip -dc $fileLoc |".  The -c
tells gzip to pipe to STDOUT, and I think that way it also doesn't
delete the .gz file.

e;

--
eric richardson -- http://ericrichardson.com -- http://blogdowntown.com


More information about the Losangeles-pm mailing list