line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Tie::Alias::Array; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
43212
|
use 5.008; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
40
|
|
4
|
1
|
|
|
1
|
|
6
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
33
|
|
5
|
1
|
|
|
1
|
|
6
|
use warnings; |
|
1
|
|
|
|
|
6
|
|
|
1
|
|
|
|
|
39
|
|
6
|
1
|
|
|
1
|
|
5
|
use Carp; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
739
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
our $VERSION = '0.01'; |
9
|
|
|
|
|
|
|
|
10
|
0
|
|
|
0
|
0
|
|
sub isAlias { 1; }; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub TIEARRAY { |
13
|
|
|
|
|
|
|
|
14
|
0
|
|
|
0
|
|
|
my ( $class , $ref ) = @_ ; |
15
|
0
|
0
|
|
|
|
|
ref($ref) or croak "NOT A REFERENCE"; |
16
|
0
|
0
|
|
|
|
|
if ( eval { tied($$ref) -> isAlias } ) { |
|
0
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
# we are re-aliasing something |
18
|
0
|
|
|
|
|
|
return tied ($$ref); |
19
|
|
|
|
|
|
|
}else{ |
20
|
|
|
|
|
|
|
# $ref is already a pointer to the object |
21
|
0
|
|
|
|
|
|
bless $ref, $class; |
22
|
|
|
|
|
|
|
}; |
23
|
|
|
|
|
|
|
}; |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub FETCH{ |
26
|
0
|
|
|
0
|
|
|
$_[0]->[$_[1]]; |
27
|
|
|
|
|
|
|
}; |
28
|
|
|
|
|
|
|
sub STORE{ |
29
|
0
|
|
|
0
|
|
|
$_[0]->[$_[1]] = $_[2]; |
30
|
|
|
|
|
|
|
}; |
31
|
|
|
|
|
|
|
sub FETCHSIZE{ |
32
|
0
|
|
|
0
|
|
|
scalar @{$_[0]}; |
|
0
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
}; |
34
|
|
|
|
|
|
|
sub STORESIZE{ |
35
|
0
|
|
|
0
|
|
|
$#{$_[0]} = $_[1] -1 ; |
|
0
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
}; |
37
|
|
|
|
|
|
|
sub POP{ |
38
|
0
|
|
|
0
|
|
|
pop @{$_[0]}; |
|
0
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
}; |
40
|
|
|
|
|
|
|
sub CLEAR{ |
41
|
0
|
|
|
0
|
|
|
@{$_[0]} = (); |
|
0
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
}; |
43
|
|
|
|
|
|
|
sub PUSH{ |
44
|
0
|
|
|
0
|
|
|
my $r = shift; |
45
|
0
|
|
|
|
|
|
push @{$r}, @_; |
|
0
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
}; |
47
|
|
|
|
|
|
|
sub SHIFT{ |
48
|
0
|
|
|
0
|
|
|
shift @{$_[0]}; |
|
0
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
}; |
50
|
|
|
|
|
|
|
sub UNSHIFT{ |
51
|
0
|
|
|
0
|
|
|
my $r = shift; |
52
|
0
|
|
|
|
|
|
unshift @{$r}, @_; |
|
0
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
}; |
54
|
|
|
|
|
|
|
sub SPLICE{ |
55
|
0
|
|
|
0
|
|
|
my $r = shift; |
56
|
0
|
|
0
|
|
|
|
my $o = shift || 0; |
57
|
0
|
|
0
|
|
|
|
my $l = shift || scalar(@{$r}) - $o; |
58
|
0
|
|
|
|
|
|
splice @{$r}, $o, $l, @_; |
|
0
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
}; |
60
|
|
|
|
|
|
|
sub DELETE{ |
61
|
0
|
|
|
0
|
|
|
delete $_[0]->[$_[1]]; |
62
|
|
|
|
|
|
|
}; |
63
|
|
|
|
|
|
|
sub EXISTS{ |
64
|
0
|
|
|
0
|
|
|
exists $_[0]->[$_[1]]; |
65
|
|
|
|
|
|
|
}; |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
1; |
68
|
|
|
|
|
|
|
__END__ |