in reply to Opening and reading .gz file
Try
See perldoc -f open for more details.my $file = "file.gz"; open(IN, "gzcat $file |") or die "gunzip $file: $!"; while ( <IN> ) { ... } close(IN);
You might want to specify the full patch to gzcat if there's a possibility that someone might sneak a trojan horse into your PATH.
Update: s/gunzip/gzcat/
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Opening and reading ,gz file
by bluto (Curate) on Aug 22, 2002 at 21:50 UTC |