0

私は他のディレクトリからファイルを読み込もうとしています。私にとってはすべてがうまく見えますが、残念ながらエラーも出力も得られません。

私はWindows PCで作業しています。

ここに私のコードがあります:

use strict;
use warnings;

use Cwd;

#chdir('C:\\APTscripts\\APStress\\Logs');
chdir('C:\\Mahi_doc\\Apstress_logs');
my ($dir_01,$dir_02);
my @FILES;
$dir_01 = getcwd;

#print "$dir\n";
opendir(DIR_01, $dir_01) ;
@FILES=readdir(DIR_01);
close(DIR_01);
my $count=12;
my $lines;
for my $dir_02 (@FILES)
{
  #print"$dir_02\n";

 if ( -d $dir_02)
 {
opendir (DIR_02, "$dir_01"."/"."$dir_02") ;
 while(our $file = readdir(DIR_02))
  {
    if($file =~ /APStress.*UIlog/g)
     {
     #  print"$file\n";
       open(FH,$file) or die "can not open the file $!\n"; 
        while (defined(my $lines = <FH>))
        { 
        print"$lines\n";
        if($lines=~ m/WATCHDOG/ || $lines=~ m/Excessive JNI/gi )
        {#chks for watchdog/excessive jni issue exist
          print "Got it\n";
        }
        elsif($lines=~ m/installd: eof/gi)
        {
            print "EOF:Got it  \n";
        }
       }
     }
   }
  } 

}
4

1 に答える 1