in reply to Garbage Collection and undef
"does undef just force garbage collection, or does it actually un-declare the my definition"
If it undeclares the array, then the following would have syntax error, but it actually not, so the answer is clear:
use strict; use warnings; my @a = (1,2,3); undef @a; $a[1] = 2; @a = undef; $a[1] = 2;
Also garbage collector does not free memory right after you tell it to, it kicks in according to its own schedule.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Garbage Collection and undef
by tilly (Archbishop) on Oct 17, 2004 at 04:19 UTC | |
by pg (Canon) on Oct 17, 2004 at 04:49 UTC | |
by tilly (Archbishop) on Oct 17, 2004 at 05:08 UTC | |
by ihb (Deacon) on Oct 17, 2004 at 05:54 UTC | |
by tilly (Archbishop) on Oct 17, 2004 at 06:30 UTC | |
by hv (Prior) on Oct 17, 2004 at 10:50 UTC |