Name : perl-Package-Anon
| |
Version : 0.05
| Vendor : obs://build_opensuse_org/devel:languages:perl
|
Release : lp154.6.1
| Date : 2023-01-27 17:21:32
|
Group : Development/Libraries/Perl
| Source RPM : perl-Package-Anon-0.05-lp154.6.1.src.rpm
|
Size : 0.04 MB
| |
Packager : https://www_suse_com/
| |
Summary : Anonymous packages
|
Description :
This module allows for anonymous packages that are independent of the main namespace and only available through an object instance, not by name.
my $stash = Package::Anon->new;
$stash->add_method(\'get_answer\', sub{ return 42; });
my $instance = $stash->bless({});
$instance->get_answer(); # returns 42
In \'$my_object->do_stuff()\' Perl uses a the name of the class \'$my_object\' is blessed into to resolve the function \'do_stuff()\'.
Packages created using Package::Anon exist outside of the \'main::\' namespace and cannot be referenced by name. These packages are defined within stashes that are only accessible through a reference rather than using a name.
Previous attempts to allow for anonymous packages in Perl use workarounds that still ultimately result in references by named packages. Because Package::Anon allows method dispatching without a name lookup, packages are truly anonymous.
|
RPM found in directory: /packages/linux-pbone/ftp5.gwdg.de/pub/opensuse/repositories/devel:/languages:/perl:/CPAN-P/15.4/x86_64 |