print "Enter keys (sep with space): "; chomp (my $key = ); print "Enter vals (sep with space): "; chomp (my $val = ); my %hash; @hash{ split '\s',$key } = split '\s',$val;