2007-07-20から1日間の記事一覧

配列からハッシュ

my @array = qw/ foo, bar, baz /; my %hash = map { $_ => 1 } @array; my @keys = qw/ foo bar baz /; my @values = qw/ hoge moge hage /; my %hash = (); @hash{@keys} = @values;