http://www.perlmonks.org?node_id=1047319


in reply to Help with my regex

You could also exclude lines that you don't want:

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

Or even simpler:

foreach (@data) { print unless /NCQ/ or /Supported/ or /^$/; }