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