Thanks in advance.# WRONG { my %hash; my @cols = qw(min max sum); my @values = qw(1 3 4); @hash{@cols} = @values; use Data::Dumper; print Dumper \%hash; } # CORRECT (but slow) { my %hash; my @cols = qw(min max sum); my @values = qw(1 3 4); foreach my $col (@cols) { push @{$hash{$col}}, shift @values; } use Data::Dumper; print Dumper \%hash; }
In reply to Creating hash of arrays (in a faster way) by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |