in reply to Re^3: Reading zipped files (.gz)
in thread Reading zipped files (.gz)

I open you link downloaded perl-5.21.3.tar.gz.

1)tar xvfz perl-5.21.3.tar.gz 2)cd perl-5.21.3

After that I cant find that .PL file in that folder. This is the correct link you provided?? Or I missing it???

Replies are listed 'Best First'.
Re^5: Reading zipped files (.gz)
by Corion (Patriarch) on Nov 18, 2015 at 09:26 UTC

    My link linked to the documentation of the module. The module comes already distributed with Perl. Why did you try to install it?

      As you suggested I changed my ls with File::Glob. Now help me in how to read .gz files???

      #!/usr/bin/perl use warnings; use strict; use File::Glob ':bsd_glob'; use Archive::Tar; use Data::Dumper; my $cdr_dir="/root/prac/NSN_SGSN"; my @list = bsd_glob('*.gz'); print Dumper \@list; foreach my $file (@list) { #open gz file, read line by line }

        You already have been introduced to the concept of reading from pipes. Maybe try

        my $cmd = sprintf 'gzip -cd "%s"', $file; open my $fh, $cmd or die "Couldn't read [$cmd]: $!";