%TEST ;
...
for {
sub atest
}
sub atest {
...
push $TEST { TEST1 }[0] = "some value "
}
How do I push values into a hash of arrays without knowing anything about index?
How do I achieve this?
This will add value to the end of array stored in hash by "TEST1" key.
push( @{ $TEST { TEST1 } }, "some value ");
I've used @{...}
to dereference array reference. Perl creates inner array reference automatically then needed.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With