in reply to Re^2: Update: problem with scalar
in thread Update: problem with scalar

Your @array variable is probably not properly populated and is likely to be empty (at least in part). This suggest that you might have an earlier problem reading the testFile.txt file.

Perhaps you could change the file opening line as follows:

open FILE, "<", 'testFile.txt' or die "Cannot open testFile.txt $!";
This will not solve the problem but at least it would tell you if the program failed to open the file.

BTW, you should always check whether such OS related statements succeed.