Name : perl-Acme-Holy
| |
Version : 0.03
| Vendor : obs://build_opensuse_org/devel:languages:perl
|
Release : lp155.8.1
| Date : 2023-07-20 17:02:46
|
Group : Development/Libraries/Perl
| Source RPM : perl-Acme-Holy-0.03-lp155.8.1.src.rpm
|
Size : 0.02 MB
| |
Packager : https://www_suse_com/
| |
Summary : Test whether references are blessed
|
Description :
*Acme::Holy* provides a single routine, *holy()*, which returns the name of the package an object has been \'bless\'ed into, or \'undef\', if its first argument is not a blessed reference.
Isn\'t this what \'ref()\' does already? Yes, and no. If given a blessed reference, \'ref()\' will return the name of the package the reference has been blessed into. However, if \'ref()\' is passed an unblessed reference, then it will return the type of reference (e.g. \'SCALAR\', \'HASH\', \'CODEREF\', etc). This means that a call to \'ref()\' by itself cannot determine if a given reference is an object. *holy()* differs from \'ref()\' by returning \'undef\' if its first argument is not a blessed reference (even if it is a reference).
Can\'t we use \'UNIVERSAL::isa()\'? Yes, and no. If you already have an object, then \'isa()\' will let you know if it inherits from a given class. But what do we do if we know nothing of the inheritance tree of the object\'s class? Also, if we don\'t have an object, just a normal reference, then attempting to call \'isa()\' through it will result in a run-time error.
*holy()* is a quick, single test to determine if a given scalar represents an object (i.e. a blessed reference).
|
RPM found in directory: /packages/linux-pbone/ftp5.gwdg.de/pub/opensuse/repositories/devel:/languages:/perl:/CPAN-A/15.5/x86_64 |