my @word1 { local *FILE; # make this a 'my $fle;' in 5.6 open( FILE, "< /path/to/$filename1" ) or die( "can't find file1: $!" ); while () { push @word1, /EditorName\s+(\w+)/g; } close FILE or die $!; }