in reply to returning word from a file position

Two problems:

  1. $file is only taking the first record from <FILE>
  2. Your regexes are capturing the last whitespace on the line, if anything.

Here is your first block rewritten:

my @word1 { local *FILE; # make this a 'my $fle;' in 5.6 open( FILE, "< /path/to/$filename1" ) or die( "can't find file1: $ +!" ); while (<FILE>) { push @word1, /EditorName\s+(\w+)/g; } close FILE or die $!; }
Those blocks are so similar, I think you should consider making a sub of them. Suggested syntax findword FILENAME, PATTERN;.

After Compline,
Zaxo