Reference Counting
Reference Counting
Posted Feb 11, 2019 19:45 UTC (Mon) by rweikusat2 (subscriber, #117920)In reply to: Reference Counting by epa
Parent article: Lisp and the foundations of computing
This is mostly correct: Weak reference support is provided via Scalar::Util module but this is part of the core Perl distribution and just provides access to some builtin functions which "people have expressed would be nice to have in the perl core, but the usage would not really be high enough to warrant the use of a keyword". A weak reference will be set to undef if the object it was referring to is destroyed. Reference cycles are sufficiently rare that this isn't much of a burden and weak references are easy enough to use.