in reply to Re: check if an element exists in array
in thread check if an element exists in array
if (!exists $people{$name}) { $people{$name} = [ $value ]; # store array with one value } else { push @{$people{$name}}, $value; # push 2nd,3rd,.. value on arr +ay }
can become
push @{$people{$name}}, $value;
I hope this is of interest.
Cheers,
JohnGG
|
|---|