#!/usr/bin/perl my $file_name = $ARGV[0]; # parsing filename the elements of this file will be sotred in @store array my $dir = $ARGV[1]; # parsing the directory in which the contents of array will be searched in each file of this directory open (F, "$file_name") || die ("Could not open $file_name!"); # opening file while($line = ) { print "pushwala while"; push (@store, $line); #storing contents of file to @store array } print "@store"; # printing contents of array close (F); # closing file opendir (DIR, $dir) or die $!; # opening directory , of which we have to precess all files my @dir = readdir DIR; foreach my $filename (@dir) { # print "$filename\n"; open (F, "$dir/$filename") || die ("Could not open $filename"); # opening Each file of the directory foreach (@store) { print "$_"; # printing contents of @store array , FIXME here is the problem this prints 3 times all the contents of @store array while($line = ) # cheking each line of files in the directory { print "$line"; # check if ($line =~ /$_/) # pattern matching between contens of array and each line of files in directory { chomp ($_); #last if; print "testcase name:$_\n"; # print "file includeing testcase:$filename\n"; # if pattern is found printing it print "line:$line\n"; # break; # breaking while loop } else { chomp ($_); print "$_:not found\n\n"; # if pattern is not found break; # breaking while loop } } } }