| 1 | package Scalar::Util::Instance; | ||||||||||
| 2 | |||||||||||
| 3 | 5 | ▶ | use 5.008_001; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 5 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 5 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | |||||||||||
| 7 | 5 | our $VERSION = '0.001'; | |||||||||
| 8 | |||||||||||
| 9 | 5 | ▶ | use XSLoader; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 10 | 5 | XSLoader::load(__PACKAGE__, $VERSION); | |||||||||
| 11 | |||||||||||
| 12 | 7 | ▶ | sub import { | ||||||||
|
Subroutine
import: called CC=4 SCAR=13.9
| |||||||||||
| 13 | 7 | my $class = shift; | |||||||||
| 14 | |||||||||||
| 15 | 7 | my $into = caller; | |||||||||
| 16 | 7 | foreach my $config(@_){ | |||||||||
| 17 | 5 | my $as = $config->{as}; | |||||||||
| 18 | 5 | ▶ | if(!defined $as){ | ||||||||
|
Branch: 1 branch
| |||||||||||
| 19 | 1 | require Carp; | |||||||||
| 20 | 1 | Carp::croak("You must define a predicate name by 'as'"); | |||||||||
| 21 | } | ||||||||||
| 22 | 4 | ▶ | if($as !~ /::/){ | ||||||||
|
Branch: 1 branch
| |||||||||||
| 23 | 3 | $as = $into . '::' . $as; | |||||||||
| 24 | } | ||||||||||
| 25 | 4 | $class->generate_for($config->{for}, $as); | |||||||||
| 26 | } | ||||||||||
| 27 | 5 | return; | |||||||||
| 28 | } | ||||||||||
| 29 | |||||||||||
| 30 | 5 | 1; | |||||||||
| 31 | __END__ | ||||||||||