Why push the hashes onto a list? You could just push the values and then refer to the list as a hash (right?) or you could just build a hashref and point $self->{valuePair} to it. If you want to have multiple values per key then just make it a hashref with lists as the values.
___________my $theHash; if ($inline =~ /<valueTargetPair (.*)\/>/) { if ($inline =~ /value=\"(.*?)\" targetPo=\"(.*?)\"/) { push @{$theHash->{$1}},$2; } } $self->{valuePair} = $theHash;
In reply to Re: hashes, arrays, and references... oh my
by eric256
in thread hashes, arrays, and references... oh my
by regan
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |