Help for this page

Select Code to Download


  1. or download this
    my %hash;
    
    my @keys = (1, 2, 3, 4, 5);               # an array of hash keys
    my @values = qw(one two three four five); # array of values
    
  2. or download this
    @hash{@keys} = @values;
    
  3. or download this
    @array[@keys] = @values
    
  4. or download this
    @words_array[1..12] = qw(one two three four five six seven eight nine 
    +ten eleven twelve);
    @words_hash{(1..12)} = qw(one two three four five six seven eight nine
    + ten eleven twelve);