Help for this page

Select Code to Download


  1. or download this
    my @colors = qw(red yellow green cyan blue magenta);
    my @grey_scale = qw(white grey black);
    
    my @list = map "$_ beads", @colors, @grey_scale;
    
  2. or download this
    my @list = map( "$_ beads", @colors ), @grey_scale;
    
  3. or download this
    my @list = ( map { "$_ beads" } @colors ), @grey_scale;
    
  4. or download this
    sub make_beads {
      my $color = shift;
    ...
    }
    
    my @list = map( make_beads($_), @colors), @grey_scale;
    
  5. or download this
    my @list = (
      map  { make_beads($_} }
    ...
      grep { <something> }
      @colors
    ), @grey_scale;