in reply to Using a hash with the @ sigil
use warnings; use strict; use Data::Dumper; my @arr = qw( a b c ); my %h; @h{@arr} = (3, 4, 5); # @hash{keys} = values print Dumper(\%h); __END__ Output: $VAR1 = { 'c' => 5, 'b' => 4, 'a' => 3 };
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Using a hash with the @ sigil
by 1nickt (Canon) on Jul 25, 2015 at 01:05 UTC | |
|
Re^2: Using a hash with the @ sigil
by Anonymous Monk on Jul 25, 2015 at 14:25 UTC |