local $/ = ''; while (<>) { next if /\A.*\nD$/m; print; }