print "Enter File name and path of .ins?"; $filename1 = ; print "Enter the name of the .rcs file to be searched?"; $filename2 = ; open( FILE, "< $filename1" ) or die( "can't find file1: $ +!" ); $/=undef; @file = ; close(FILE); print @file,\n; foreach $line (@file) { $line =~ /.*EditorName\b.*\b(.+?)\b/; $word1 = $1;} foreach $line2 (@file) { $line2 =~ /.*EditorCommand\s+'(\w+)'\s/; @word2 = $1;} print @word2, \n; open FILE, ">test54.txt" or die "Could not open file: $!\n"; open (Output, ">test54.txt"); foreach $word2 (@word2) { { $pattern = $word1.":".$word2; if (in_file($pattern, $filename2) ) { + print Output "Found $pattern in $filename2\n"; } else { print "$pattern not found in $filename2.\n"; } sub in_file { my ($pattern, $filename2) = @_; open FILE, $filename2 or die "Can't open $filename: $!\n"; my $found =0; while () { $found=1, last if /$pattern/; } close FILE; $found; } } }