Help for this page

Select Code to Download


  1. or download this
    my @keynames = qw/first second third fourth/;
    
    my %hash = map { $_, 0 } @keynames;
    
  2. or download this
    my @keynames = qw/first second third fourth/;
    my @squares = map {  $_ ** 2 } (1 .. 4);
    
    my %hash;
    @hash{@keynames} = @squares;