$x = 1; print join " ", grep { $x..(($x=0) or /D/) } qw(A B C D E F);