in reply to Re: Pushing hash ref onto array ref
in thread Pushing hash ref onto array ref
I'd use push @{ $hash->{'key'} }, $new out of habit personally, but if you've got a new enough perl (post 5.24.0 according to perlref; you can use back to 5.20 with a feature declaration) you could use the new postfix deref syntax push $hash->{'key'}->@*, $new instead.
Edit: Clarified version requirement.
The cake is a lie.
The cake is a lie.
The cake is a lie.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Pushing hash ref onto array ref
by kcott (Archbishop) on Apr 12, 2021 at 10:58 UTC | |
by Bod (Parson) on Apr 12, 2021 at 11:51 UTC |