Packages / openSUSE Tumbleweed / Source / Development/Libraries/Perl / perl-UNIVERSAL-can

Source Package: perl-UNIVERSAL-can (1.20140328-3.38)

work around buggy code calling UNIVERSAL::can() as a function

The UNIVERSAL class provides a few default methods so that all objects can use them. Object orientation allows programmers to override these methods in subclasses to provide more specific and appropriate behavior. Some authors call methods in the UNIVERSAL class on potential invocants as functions, bypassing any possible overriding. This is wrong and you should not do it. Unfortunately, not everyone heeds this warning and their bad code can break your good code. This module replaces 'UNIVERSAL::can()' with a method that checks to see if the first argument is a valid invocant has its own 'can()' method. If so, it gives a warning and calls the overridden method, working around buggy code. Otherwise, everything works as you might expect. Some people argue that you must call 'UNIVERSAL::can()' as a function because you don't know if your proposed invocant is a valid invocant. That's silly. Use 'blessed()' from the Scalar::Util manpage if you want to check that the potential invocant is an object or call the method anyway in an 'eval' block and check for failure (though check the exception _returned_, as a poorly-written 'can()' method could break Liskov and throw an exception other than "You can't call a method on this type of invocant"). Just don't break working code.

Package information

Homepage
[http://search.cpan.org/dist/UNIVERSAL-can/]
License
Artistic-1.0 or GPL-1.0+
Mantenedor del paquete downstream
Desconocido: no consta en la fuente indexada

The following binary packages are built from this source package:

Vulnerabilidades conocidas

No hay avisos coincidentes en las fuentes consultadas.

Última sincronización:

[Catálogo de CVE]

Fuentes

  • Authoritative source; repository metadata signature verified

    Prueba de firma

    tumbleweed-oss-multiarch:4db10cdde3ad82c7e22be35753c9e164b4bdd30f92db4aee17a0d4c94c5f902f

    Repository-signature verification record
    Signed-object SHA-256
    4db10cdde3ad82c7e22be35753c9e164b4bdd30f92db4aee17a0d4c94c5f902f
    Signer fingerprint
    AD485664E901B867051AB15F35A2F86E29B700A4
    Keyring revision
    opensuse-project-signing-key.asc
    SHA-256 b5745739ebfb95b25b8e810f9bcb847fe750ccda598bd85f02f0e974599a6d7e
    Tool and policy
    gpgv (GnuPG) 2.4.9
    openfactory-software-catalog-signature-v1
    Verification time
    Sep 1, 2026
    Repository metadata hash linkage
    Result
    Recorded as verified; digest details unavailable