Index index by Group index by Distribution index by Vendor index by creation date index by Name Mirrors Help Search

perl-Safe-Isa-1.000010-lp152.3.2 RPM for noarch

From OpenSuSE Leap 15.2 for noarch

Name: perl-Safe-Isa Distribution: openSUSE Leap 15.2
Version: 1.000010 Vendor: openSUSE
Release: lp152.3.2 Build date: Fri Sep 20 18:21:20 2019
Group: Development/Libraries/Perl Build host: lamb11
Size: 13892 Source RPM: perl-Safe-Isa-1.000010-lp152.3.2.src.rpm
Packager: https://bugs.opensuse.org
Url: http://search.cpan.org/dist/Safe-Isa/
Summary: Call isa, can, does and DOES safely on things that may not be objects
How many times have you found yourself writing:

  if ($obj->isa('Something')) {

and then shortly afterwards cursing and changing it to:

  if (Scalar::Util::blessed($obj) and $obj->isa('Something')) {

Right. That's why this module exists.

Since perl allows us to provide a subroutine reference or a method name to
the -> operator when used as a method call, and a subroutine doesn't
require the invocant to actually be an object, we can create safe versions
of isa, can and friends by using a subroutine reference that only tries to
call the method if it's used on an object. So:

  my $isa_Foo = $maybe_an_object->$_call_if_object(isa => 'Foo');

is equivalent to

  my $isa_Foo = do {
    if (Scalar::Util::blessed($maybe_an_object)) {
      $maybe_an_object->isa('Foo');
    } else {
      undef;
    }
  };

Note that we don't handle trying class names, because many things are valid
class names that you might not want to treat as one (like say "Matt") - the
'is_module_name' function from Module::Runtime is a good way to check for
something you might be able to call methods on if you want to do that.

We are careful to make sure that scalar/list context is preserved for the
method that is eventually called.

Provides

Requires

License

Artistic-1.0 OR GPL-1.0-or-later

Changelog

* Thu Apr 26 2018 coolo@suse.com
  - updated to 1.000010
    see /usr/share/doc/packages/perl-Safe-Isa/Changes
    1.000010 - 2018-04-25
    - fix DOES tests on 5.8.x
* Sun Apr 22 2018 coolo@suse.com
  - updated to 1.000009
    see /usr/share/doc/packages/perl-Safe-Isa/Changes
    1.000009 - 2018-04-21
    - Fix handling of DOES and does (they no longer fall back to isa in most
      situations outside of Moo/Moose)
* Sun Oct 08 2017 coolo@suse.com
  - updated to 1.000008
    see /usr/share/doc/packages/perl-Safe-Isa/Changes
    1.000008 - 2017-10-03
    - fix scalar/list context handling for $_call_if_can
* Fri Sep 22 2017 coolo@suse.com
  - updated to 1.000007
    see /usr/share/doc/packages/perl-Safe-Isa/Changes
    1.000007 - 2017-09-22
    - added new interface: $obj->$_call_if_can
* Tue Nov 01 2016 coolo@suse.com
  - updated to 1.000006
    see /usr/share/doc/packages/perl-Safe-Isa/Changes
    1.000006 - 2016-10-31
    - now falling back to $obj->isa if DOES/does is not implemented on the
      object, to avoid fatal errors on perls too old to have their own DOES
      (RT#100866)
* Fri Sep 19 2014 coolo@suse.com
  - updated to 1.000005
    - comment blessed use so people who don't know perl stop trying to break it
    - add link to lightning talk given at YAPC::NA 2013
* Sat Mar 15 2014 coolo@suse.com
  - updated to 1.000004
    - fixed slightly mangled metadata from last release
* Wed Sep 04 2013 coolo@suse.com
  - initial package 1.000003
    * created by cpanspec 1.78.07

Files

/usr/lib/perl5/vendor_perl/5.26.1/Safe
/usr/lib/perl5/vendor_perl/5.26.1/Safe/Isa.pm
/usr/lib/perl5/vendor_perl/5.26.1/x86_64-linux-thread-multi
/usr/share/doc/packages/perl-Safe-Isa
/usr/share/doc/packages/perl-Safe-Isa/Changes
/usr/share/doc/packages/perl-Safe-Isa/README
/usr/share/man/man3/Safe::Isa.3pm.gz


Generated by rpm2html 1.8.1

Fabrice Bellet, Tue Apr 9 11:50:38 2024