line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
1
|
|
|
1
|
|
749
|
use 5.008; |
|
1
|
|
|
|
|
3
|
|
2
|
1
|
|
|
1
|
|
6
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
20
|
|
3
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
80
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
package Acme::Marvel::CinematicUniverse::Characters; |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:TOBYINK'; |
8
|
|
|
|
|
|
|
our $VERSION = '0.002'; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
use Module::Pluggable ( |
11
|
1
|
|
|
|
|
8
|
search_path => [ 'Acme::Marvel::CinematicUniverse::Character::Instance' ], |
12
|
|
|
|
|
|
|
sub_name => 'instance_modules', |
13
|
|
|
|
|
|
|
require => 1, |
14
|
1
|
|
|
1
|
|
516
|
); |
|
1
|
|
|
|
|
11077
|
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
my @characters; |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub load_character { |
19
|
6
|
|
|
6
|
1
|
11
|
my ( $class ) = ( shift ); |
20
|
6
|
|
|
|
|
29
|
push @characters, @_; |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub characters { |
24
|
1
|
|
|
1
|
1
|
580
|
my ( $class ) = ( shift ); |
25
|
1
|
|
|
|
|
6
|
return @characters; |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
sub find { |
29
|
2
|
|
|
2
|
1
|
8
|
my ( $class, $search ) = ( shift, @_ ); |
30
|
|
|
|
|
|
|
my $re = ref($search) |
31
|
|
|
|
|
|
|
? $search |
32
|
2
|
100
|
|
|
|
8
|
: do { my $q = quotemeta( $search ); qr/$q/i }; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
13
|
|
33
|
2
|
|
|
|
|
46
|
my @found = grep /$re/, @characters; |
34
|
2
|
100
|
|
|
|
34
|
wantarray ? @found : $found[0]; |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
$_->init( __PACKAGE__ ) |
38
|
|
|
|
|
|
|
for __PACKAGE__->instance_modules; |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
1; |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
__END__ |