Help for this page

Select Code to Download


  1. or download this
    use Data::Dumper;
    
    @keys = qw(A B C);
    @values = qw(1 2 3);
    
  2. or download this
    @hash{@keys} = @values;
    print Dumper(\%hash);
    
  3. or download this
    %hash=();
    
    $hash{x}{A} = 1;
    $hash{x}{B} = 2;
    $hash{x}{C} = 3;
    print Dumper(\%hash);
    
  4. or download this
    %hash=();
    $hash{x}{@keys} = @values;
    print Dumper(\%hash);
    
  5. or download this
    @hash{x}{@keys} = @values;
  6. or download this
    @{$hash{x}{@keys}} = @values;