Name : perl-WeakRef
| |
Version : 0.01
| Vendor : obs://build_opensuse_org/devel:languages:perl
|
Release : lp154.1.1
| Date : 2023-01-27 17:23:47
|
Group : Development/Libraries/Perl
| Source RPM : perl-WeakRef-0.01-lp154.1.1.src.rpm
|
Size : 0.01 MB
| |
Packager : https://www_suse_com/
| |
Summary : An API to the Perl weak references
|
Description :
A patch to Perl 5.005_55 by the author implements a core API for weak references. This module is a Perl-level interface to that API, allowing weak references to be created in Perl.
A weak reference is just like an ordinary Perl reference except that it isn\'t included in the reference count of the thing referred to. This means that once all references to a particular piece of data are weak, the piece of data is freed and all the weak references are set to undef. This is particularly useful for implementing circular data structures without memory leaks or caches of objects.
The command
use WeakRef;
exports two symbols to the user\'s namespace by default: \'weaken\' and \'isweak\'. \'weaken\' takes a single argument, the reference to be weakened, and returns the same value. The idiom
weaken($this->{Thing}->{Parent} = $this);
is useful.
The \'isweak\' command takes a single parameter and returns true if the parameter is a weak reference, undef otherwise.
|
RPM found in directory: /packages/linux-pbone/ftp5.gwdg.de/pub/opensuse/repositories/devel:/languages:/perl:/CPAN-W/15.4/x86_64 |