foreach (@diaglist) { next if /Clock/; next if /Switch/; next if /Power/; next if /Processor/; push @something, $_; }