Help for this page

Select Code to Download


  1. or download this
        sub my_map {
            my $special_thingy = shift;
    ...
                apply($special_thingy, $item);
            }
        }
    
  2. or download this
        my ($special_thingy, @list_of_items) = @_;
    
  3. or download this
        sub my_map {
            foreach my $item (@_[1 ..$#_]) {
                apply($_[0], $item);
            }
        }
    
  4. or download this
        sub my_map {
            for (my $i = 1; $i < @_; $i++) {
                apply($_[0], $_[$i]);
            }
        }