rajsai28 has asked for the wisdom of the Perl Monks concerning the following question:
As i mentioned in the title, i need to execute some unix commands on the files which i read from the directory
sub zPrivateSub { my $dir = $OUTPUT_DIR; my $pattern = 'Jun'; opendir( DIR, $dir ); my @files = grep( /$pattern/, readdir(DIR) ); closedir(DIR); foreach my $file (@files) { if ($file=~ m/orig/) { my $lcmd = system("wc -l $file"); } else { print "NO\n";} } }
gives me this error message / faulty output:
orig_file.dat.gz wc: cannot open orig_file.dat.gz
please help me on this.
Thanks
|
|---|