sriram_perl_diver has asked for the wisdom of the Perl Monks concerning the following question:
The issue :use Data::Dumper; use POSIX qw(strftime); use File::Copy; if($#ARGV == -1 || $#ARGV != 0) { die("\nPlease enter the Compressed folder name along with extensio +n as an argument!\n"); exit; } my $compPackage = $ARGV[0]; my $dir = "."; my $input_dir = ''; if(index($compPackage, ".zip") != -1) { print "Extracting the ZIP package..\n"; system ("unzip -u $compPackage"); print "Extraction Completed\n"; $input_dir = substr $compPackage, 0, -4; } else { $input_dir = $compPackage; print "Folder Processed\n"; } chmod 0755, $input_dir; opendir D, $input_dir or die "Could not open dir: $!\n"; my @fileName = grep(/index/i, readdir D); if(index(@fileName, "txt") == -1) { die("Index file not found / is not valid!.\nPlease ensure the inde +x file is in the Input folder and with '.txt' extension\n"); exit; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Confusion with Unzip and GREP
by Eily (Monsignor) on Dec 11, 2014 at 10:39 UTC | |
|
Re: Confusion with Unzip and GREP
by Anonymous Monk on Dec 11, 2014 at 10:29 UTC | |
|
Re: Confusion with Unzip and GREP
by DanBev (Scribe) on Dec 11, 2014 at 10:40 UTC | |
by Anonymous Monk on Dec 11, 2014 at 10:49 UTC | |
by Anonymous Monk on Dec 11, 2014 at 10:52 UTC | |
by Anonymous Monk on Dec 11, 2014 at 10:58 UTC | |
by Eily (Monsignor) on Dec 11, 2014 at 13:40 UTC |