in reply to Re^8: Use of freed value in iteration
in thread Use of freed value in iteration
It fixed that particular demo. The script output became: aaa bbb aaa bbb
If $_[0] is supposed to be an alias of $a[0] and $_[1] an alias of $a[ +1], I'm not sure I'd want that second print "@_\n" to print aaa bbb.
At least in a loop, if an object has been deleted I'd want that to be noticed when trying to access it. It seems like the desirable behavior, regardless of what the refcount is doing, would be for 1) deleted values occurring within the loop to be reflected if those values are accessed, but 2) the memory occupied by those values couldn't be reused by a different object during the loop. This may be desirable for the subroutine behavior also.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^10: Use of freed value in iteration
by dave_the_m (Monsignor) on Feb 25, 2024 at 12:16 UTC | |
by Danny (Chaplain) on Feb 25, 2024 at 21:58 UTC | |
by dave_the_m (Monsignor) on Feb 25, 2024 at 22:42 UTC |