Are those lines empty or full of tab characters? Maybe the CytokineArrays.txt file ends by some 900 empty lines. Try to add
next unless /\S/;
after the chomp; in the second loop.
Also, there is no difference between $var =~ /\S+/ and $var =~ /\S/. Except that the later will probably be quicker. Both return true whenever there is at least one non-whitespace-character anywhere in the $var. Same with the \d. Maybe you wanted $var =~ /^\S+$/. Which means ... make sure the $var contains only non-whitespace-characters and is not empty.
Update: fixed the typo noticed by jwkrahn. I meant \S+ and wrote \s+.
|