Help for this page

Select Code to Download


  1. or download this
    my %hash = (
       foo => 2,
    ...
    );
    
    my @array = sort {$hash{$a} <=> $hash{$b}} keys %hash;
    
  2. or download this
    my @array_of_hashes;
    push @array_of_hashes, {key => $_, value => $hash{$_}} for @sorted;
    
  3. or download this
    use Data::Dumper;
    print Dumper(\@array_of_hashes);
    
  4. or download this
    $VAR1 = [
              {
    ...
                'key' => 'baz'
              }
            ];