Help for this page

Select Code to Download


  1. or download this
    my %hash = ('a'=>1, 'b'=>1, 'c'=>1);
    @hash{'a'..'c'} = 2;
    
  2. or download this
    $VAR1 = {
              'a' => 2,
              'b' => undef,
              'c' => undef
            };
    
  3. or download this
    my %hash = ('a'=>1, 'b'=>1, 'c'=>1);
    @hash{'a'..'c'} = 2;
    ...
    %hash = ('a'=>1, 'b'=>1, 'c'=>1);
    ($hash{'a'}, $hash{'b'}, $hash{'c'}) = 2;
    print Dumper  \%hash;