- or download this
my %struct;
foreach my $elem (@elements) { # loop over all the elements
...
# push a reference to the newly created hash on the array stored for
+ this element type.
push @{$struct{$elem->name}},\%hash;
}
- or download this
push @{$hash{$key}},'var' unless @{$hash{$key}}>5;
- or download this
push @{$hash{$key}},'var' unless @{$hash{$key}||[]}>5;