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

What does your reply have to do with my remarks?

I pointed out where problems in your program lie, which lead to you not being able to read the files. Have you addressed the immediate problems I pointed out?

It is bad style to use `ls ...`. I prefer to use File::Glob::bsd_glob to expand wildcards. This also eliminates the need to remove whitespace at the end of filenames.

Replies are listed 'Best First'.
Re^4: Reading zipped files (.gz)
by ravi45722 (Pilgrim) on Nov 18, 2015 at 09:25 UTC

    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???

      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 }