use strict; while() { next if /^Bad/; print; } __DATA__ Good:Good morning Bad:Shut up Good:You're welcome Bad:No!