line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Scalar::LockRefType; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
921
|
use 5.010; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
36
|
|
4
|
1
|
|
|
1
|
|
6
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
32
|
|
5
|
1
|
|
|
1
|
|
14
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
29
|
|
6
|
1
|
|
|
1
|
|
4
|
use Carp; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
255
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
our $VERSION = '0.03'; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub TIESCALAR { |
11
|
9
|
|
|
9
|
|
5966
|
my ($class, $type) = @_; |
12
|
9
|
100
|
|
|
|
86
|
return bless { |
|
|
100
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
13
|
|
|
|
|
|
|
value => undef, |
14
|
|
|
|
|
|
|
type => @_ < 2 ? undef |
15
|
|
|
|
|
|
|
: ref($type) ? ref($type) |
16
|
|
|
|
|
|
|
: length($type) ? $type |
17
|
|
|
|
|
|
|
: '' |
18
|
|
|
|
|
|
|
}; |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
|
21
|
9
|
|
|
9
|
|
58
|
sub FETCH { return $_[0]->{value} } |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub STORE { |
24
|
8
|
|
|
8
|
|
116
|
my ($self, $value) = @_; |
25
|
8
|
|
50
|
|
|
28
|
my $ref = ref $value // ''; |
26
|
8
|
|
66
|
|
|
27
|
$self->{type} //= $ref; |
27
|
8
|
100
|
|
|
|
75
|
croak 'invalid reference type' if $ref ne $self->{type}; |
28
|
5
|
|
|
|
|
23
|
return $self->{value} = $value; |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
__END__ |