my @data; for my $set (split /#/, $patterns) { my @vals = split /\s+/, $set; my %hash; for my $i (0 .. $#vals) { $hash{$names[$i]} = $vals[$i]; } push @data, \%hash; }
my @data; for ( split /#/, $patterns ) { my %hash; @hash{ @names } = split; push @data, \%hash; }
In reply to Re^2: Help creating a data structure out of a delimited string
by jwkrahn
in thread Help creating a data structure out of a delimited string
by Conal
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |