my ( @revision_array, @current_revision); while () { my $status; if ( $status = // .. // and $status != 1 and $status !~ /E/ ) { push @current_revision, $_; } if ( $status =~ /E/ ) { push @revision_array, join '', @current_revision; undef @current_revision; } } my $count; for my $revision (@revision_array) { print 'revision ', ++$count, ": \n$revision\n"; } __DATA__ somthing some revised text some other regular tags and stuff
another revision the rest of the document