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