while (<$fh>) { s/foo/bar/ and next; s/yada/yada/ and next; #lots more of the same } continue { print $_; }