my $match = 'status|power'; foreach (@data) { if (/$match/i) { print $_; } }