my@colors=('red', 'cyan', 'yellow', 'blue' ); my @yw_colors = grep {/yw/} @colors;