in reply to Re^9: Use of freed value in iteration
in thread Use of freed value in iteration
I'm not sure I'd want that second print "@_\n" to print aaa bbb.I'd want it to. Consider this:
I'd expect that to print "aaa". This is pretty much at the heart of the reference-counting model at the heart of perl. Similarly to how the fact that the lexical var getting freed on scope exit doesn't free the return value in:my @a = qw(aaa bbb); my $r = \$a[0]; @a = (); print $$r;
sub f { my $x = ...; return $x }
Dave.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^11: Use of freed value in iteration
by Danny (Chaplain) on Feb 25, 2024 at 21:58 UTC | |
by dave_the_m (Monsignor) on Feb 25, 2024 at 22:42 UTC |