Help for this page

Select Code to Download


  1. or download this
    map { MAPCLAUSE } grep { GREPLCAUSE }
    
  2. or download this
    map { GREPCLAUSE ? MAPCLAUSE : () }
    
  3. or download this
    @odds_squared = map { $_**2 } grep { $_%2 } 1..10;
    @odds_squared = map { $_%2 ? $_**2 : () } 1..10;
    
    Result: 1 9 25 49 81