foreach (@lines) { print if /whatever/; }