How Perl one-liner for herding a group of sequences, out of its superset group, to be processed in a block of codes
The task fail done:
$ for i in {1..9} ;{ echo $i ;} |perl -pe 'my $s; if (/3/) { while(1) { $s .= $_; print $s; last if (/7/) } } '
to use Perl -pe option do output of string lines of:
1
2
3
4567
8
9