in reply to Search strings stored in array into files of a directory

Welcome to the monastery. We strongly suggest you add the following to the top of your code...

use strict; use warnings;

Besides being just good form - it helps debugging immensely.