in reply to Re^7: references--hard vs anonymous operational weirdness
in thread references--hard vs anonymous operational weirdness
On each iteration of the loop the (simplified) process is
- Allocate memory for @array
- Initialize @array
- Deallocate memory assigned to @array
Well, I don't know what you mean by "Initialize @array", but otherwise, that's the documented behaviour. And in most cases — including the one you called optimized — it's the observable behaviour.
Perl, however, is not that simple and its loop would be more like
- Allocate memory for @array
- Initialize @array
- Deallocate memory assigned to @array if not referred to else where
No, that's not what it does. For starters, the @array is never deallocated by the loop (or sub).
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^9: references--hard vs anonymous operational weirdness
by hipowls (Curate) on Mar 24, 2008 at 21:20 UTC | |
by ikegami (Patriarch) on Mar 25, 2008 at 03:47 UTC |