It is a misunderstaning that reference counting always causes immediate garbage collection. There are different algorithms, and counting reference is much more complex than you thought. As a matter fact, in order to resolve problems including cyclic garbage, Perl uses Deutsch and Bobrow's deferred reference counting. This algorithm ignores updates to local variables, and it periodically scans the stack to determine the true reference counts.
In reply to Re^3: Garbage Collection and undef
by pg
in thread Garbage Collection and undef
by Irinotecan
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |