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/
In reply to Re: Opening and reading ,gz file
by dws
in thread Opening and reading .gz file
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |