in reply to use of uninitialized value in array

...and check that your opens actually work (against possible typo in name, CWD is wrong dir; etc):

open (HFR, '<', 'HFR_genes.txt') or die "Can't open for reading HFR_ge +nes.txt, $!";

Updated to correct file name; miscopied from OP.

My apologies to all those electrons which were inconvenienced by the creation of this post.