#!/util/bin/perl -w use strict; my $in_cds=0; while (<>){ if ( /^ misc_feature / ) { $in_cds =1; } elsif ( /^ /){ # with feature record. No state change. } else { $in_cds =0; } if ( ! $in_cds ) { print; } }