line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Array::Frugal; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
8540
|
use 5.000; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
43
|
|
4
|
1
|
|
|
1
|
|
7
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
38
|
|
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
6
|
use vars qw /$VERSION/; |
|
1
|
|
|
|
|
6
|
|
|
1
|
|
|
|
|
294
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
$VERSION = '0.01'; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
# Preloaded methods go here. |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub new{ |
14
|
1
|
|
|
1
|
0
|
115
|
bless [1,2,3,4,5,6,7,0]; |
15
|
|
|
|
|
|
|
} |
16
|
|
|
|
|
|
|
sub PUSH{ # pop reuse stack or extend |
17
|
16
|
|
|
16
|
|
23
|
my $a = shift; |
18
|
16
|
|
|
|
|
23
|
my $i = $a->[0]; |
19
|
16
|
100
|
|
|
|
27
|
if($i){ |
20
|
11
|
|
|
|
|
16
|
$a->[0] = $a->[$i]; |
21
|
|
|
|
|
|
|
}else{ |
22
|
5
|
|
|
|
|
12
|
$i = ++$#$a; #extend |
23
|
|
|
|
|
|
|
}; |
24
|
16
|
|
|
|
|
21
|
$a->[$i] = shift; |
25
|
16
|
|
|
|
|
62
|
$i; |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
sub FETCH{ |
29
|
15
|
|
|
15
|
|
17
|
${$_[0]}[$_[1]]; |
|
15
|
|
|
|
|
54
|
|
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
sub STORE{ |
32
|
1
|
|
|
1
|
|
2
|
${$_[0]}[$_[1]] = $_[2]; |
|
1
|
|
|
|
|
4
|
|
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
sub DELETE{ # stack index for reuse |
36
|
12
|
|
|
12
|
|
15
|
my $r = ${$_[0]}[$_[1]]; |
|
12
|
|
|
|
|
18
|
|
37
|
12
|
|
|
|
|
11
|
${$_[0]}[$_[1]] = ${$_[0]}[0]; |
|
12
|
|
|
|
|
33
|
|
|
12
|
|
|
|
|
15
|
|
38
|
12
|
|
|
|
|
12
|
${$_[0]}[0] = $_[1]; |
|
12
|
|
|
|
|
15
|
|
39
|
12
|
|
|
|
|
45
|
$r; |
40
|
|
|
|
|
|
|
}; |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
1; |
43
|
|
|
|
|
|
|
__END__ |