line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Squirrel; |
2
|
2
|
|
|
2
|
|
460
|
use strict; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
41
|
|
3
|
2
|
|
|
2
|
|
5
|
use warnings; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
415
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
sub _choose_backend { |
6
|
1
|
50
|
|
1
|
|
2
|
if ( $INC{"Moose.pm"} ) { |
7
|
|
|
|
|
|
|
return { |
8
|
0
|
|
|
|
|
0
|
backend => 'Moose', |
9
|
|
|
|
|
|
|
import => \&Moose::import, |
10
|
|
|
|
|
|
|
unimport => \&Moose::unimport, |
11
|
|
|
|
|
|
|
}; |
12
|
|
|
|
|
|
|
} else { |
13
|
1
|
|
|
|
|
316
|
require Mouse; |
14
|
|
|
|
|
|
|
return { |
15
|
1
|
|
|
|
|
11
|
backend => 'Mouse', |
16
|
|
|
|
|
|
|
import => \&Mouse::import, |
17
|
|
|
|
|
|
|
unimport => \&Mouse::unimport, |
18
|
|
|
|
|
|
|
}; |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
my %pkgs; |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
sub _handlers { |
25
|
4
|
|
|
4
|
|
6
|
my $class = shift; |
26
|
|
|
|
|
|
|
|
27
|
4
|
|
|
|
|
6
|
my $caller = caller(1); |
28
|
|
|
|
|
|
|
|
29
|
4
|
|
66
|
|
|
19
|
$pkgs{$caller} ||= $class->_choose_backend; |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
sub import { |
33
|
2
|
|
|
2
|
|
16
|
require Carp; |
34
|
2
|
|
|
|
|
376
|
Carp::carp("Squirrel is deprecated. Please use Any::Moose instead. It fixes a number of design problems that Squirrel has."); |
35
|
|
|
|
|
|
|
|
36
|
2
|
|
|
|
|
16
|
my $handlers = shift->_handlers; |
37
|
2
|
|
|
|
|
6
|
unshift @_, $handlers->{backend}; |
38
|
2
|
|
|
|
|
3
|
goto &{$handlers->{import}}; |
|
2
|
|
|
|
|
7
|
|
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
sub unimport { |
42
|
2
|
|
|
2
|
|
26
|
my $handlers = shift->_handlers; |
43
|
2
|
|
|
|
|
7
|
unshift @_, $handlers->{backend}; |
44
|
2
|
|
|
|
|
2
|
goto &{$handlers->{unimport}}; |
|
2
|
|
|
|
|
8
|
|
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
1; |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
__END__ |