my ($failedTest) = grep { /FAIL/ } @reportContents; ...