in reply to Re: autovivified hash key with foreach $x ( @{$h{a}} ) {}. (Update x2)
in thread autovivified hash key with foreach $x ( @{$h{a}} ) {}

because of the aliasing, it's also an lvalue

More precisely, because a modifiable alias is required.

because it's too complicated to implement.

I don't think so. We already do that for hash elements, and the same approach could be used to handle more complicated cases. It's a question of performance.

  • Comment on Re^2: autovivified hash key with foreach $x ( @{$h{a}} ) {}. (Update x2)

Replies are listed 'Best First'.
Re^3: autovivified hash key with foreach $x ( @{$h{a}} ) {}. (Update x2)
by LanX (Saint) on May 18, 2024 at 13:23 UTC

      What about it?