| 1 | 1 | ▶ | use 5.008; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 2 | 1 | ▶ | use strict qw( vars subs ); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 3 | 1 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | |||||||||||
| 5 | package Safe::Isa::XS; | ||||||||||
| 6 | |||||||||||
| 7 | 1 | ▶ | use base qw( XSLoader Exporter ); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 8 | 1 | ▶ | use Scalar::Util qw( blessed ); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 9 | |||||||||||
| 10 | 1 | our $AUTHORITY = 'cpan:TOBYINK'; | |||||||||
| 11 | 1 | our $VERSION = '0.000_02'; | |||||||||
| 12 | 1 | our @EXPORT = qw( $_call_if_object $_isa $_can $_does $_DOES ); | |||||||||
| 13 | |||||||||||
| 14 | 1 | __PACKAGE__->load($VERSION); | |||||||||
| 15 | |||||||||||
| 16 | 1 | for (qw( _isa _can _does _DOES )) { | |||||||||
| 17 | 4 | ${"Safe::Isa::XS::$_"} = \&$_; | |||||||||
| 18 | } | ||||||||||
| 19 | |||||||||||
| 20 | # Too lazy to write an XS version of this... | ||||||||||
| 21 | 3 | ▶ | our $_call_if_object = sub { | ||||||||
|
Subroutine
__ANON__: called CC=2 SCAR=6.9
| |||||||||||
| 22 | 3 | my ($obj, $method) = (shift, shift); | |||||||||
| 23 | 3 | ▶ | return unless blessed($obj); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 24 | 2 | return $obj->$method(@_); | |||||||||
| 25 | 1 | }; | |||||||||
| 26 | |||||||||||
| 27 | 1 | shift our @ISA; | |||||||||
| 28 | |||||||||||
| 29 | __END__ | ||||||||||