Help for this page

Select Code to Download


  1. or download this
        @foobar = reduce {[@^a ^+ @^b]} @foo, @bar, @baz, @etc;
    
  2. or download this
        {[@^a ^+ @^b]}
    
  3. or download this
        sub (@a, @b) { return [@a ^+ @b] }
    
  4. or download this
        # sum of maximal values...
        $maxsum = reduce { $^a + max(@^b) } 0, @foo, @bar, @etc;
    
  5. or download this
        # grep out hash entries whose key *or* value is 'moo'...
        %cow = map { any($^key,$^val) eq 'moo' ?? $^key => $^val :: () } %
    +animals;
    
  6. or download this
        sub ($key, $val) { ... }