Help for this page

Select Code to Download


  1. or download this
    my %results;
    
    ...
    {
        $results{$_} = some_func($_);
    }
    
  2. or download this
    my @results;
    for ( @array )
    {
        push @results, { input => $_, output => some_func($_) };
    }
    
  3. or download this
    my %results = map { ( $_ => some_func($_) ) } @array;
    
  4. or download this
    my @results = map { { input => $_, output => some_func($_) } } @array;