| 1 | 10 | ▶ | use utf8; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 2 | 10 | ▶ | use strict; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 3 | 10 | ▶ | use warnings; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 4 | 10 | ▶ | no warnings qw(uninitialized); | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 5 | |||||||||||||||||||||
| 6 | |||||||||||||||||||||
| 7 | #=============================================== | ||||||||||||||||||||
| 8 | package XML::Pastor::Stack; | ||||||||||||||||||||
| 9 | |||||||||||||||||||||
| 10 | |||||||||||||||||||||
| 11 | 10 | our $VERSION = '0.01'; | |||||||||||||||||||
| 12 | |||||||||||||||||||||
| 13 | 33 | ▶ | sub new { | ||||||||||||||||||
|
Subroutine
new: called CC=3 SCAR=13.0
Pod
documented
| |||||||||||||||||||||
| 14 | 33 | my $proto = shift(); | |||||||||||||||||||
| 15 | 33 | ▶ | my $class = ref($proto) || $proto; | ||||||||||||||||||
|
Condition33%1/3
ref $proto || $proto
MC/DC0%0/2
ref $proto || $proto
ref $proto
$proto
Truth table33%1/3
A || B
A= ref $protoB= $proto
| |||||||||||||||||||||
| 16 | |||||||||||||||||||||
| 17 | 33 | my $self = []; | |||||||||||||||||||
| 18 | 33 | ▶ | if(@_) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 19 | 0 | push(@{ $self }, @_); | |||||||||||||||||||
| 20 | } | ||||||||||||||||||||
| 21 | |||||||||||||||||||||
| 22 | 33 | return bless($self, $class); | |||||||||||||||||||
| 23 | } | ||||||||||||||||||||
| 24 | |||||||||||||||||||||
| 25 | 2679 | ▶ | sub peek { | ||||||||||||||||||
|
Subroutine
peek: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||
| 26 | 2679 | my $self = shift(); | |||||||||||||||||||
| 27 | |||||||||||||||||||||
| 28 | 2679 | return $self->get(0); | |||||||||||||||||||
| 29 | } | ||||||||||||||||||||
| 30 | |||||||||||||||||||||
| 31 | 0 | ▶ | sub clear { | ||||||||||||||||||
|
Subroutine
clear: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||
| 32 | 0 | my $self = shift(); | |||||||||||||||||||
| 33 | |||||||||||||||||||||
| 34 | 0 | $#{ $self } = -1; | |||||||||||||||||||
| 35 | } | ||||||||||||||||||||
| 36 | |||||||||||||||||||||
| 37 | 3404 | ▶ | sub get { | ||||||||||||||||||
|
Subroutine
get: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||
| 38 | 3404 | my $self = shift(); | |||||||||||||||||||
| 39 | 3404 | my $index = shift(); | |||||||||||||||||||
| 40 | |||||||||||||||||||||
| 41 | 3404 | return $self->[$index]; | |||||||||||||||||||
| 42 | } | ||||||||||||||||||||
| 43 | |||||||||||||||||||||
| 44 | 1292 | ▶ | sub count { | ||||||||||||||||||
|
Subroutine
count: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||
| 45 | 1292 | my $self = shift(); | |||||||||||||||||||
| 46 | |||||||||||||||||||||
| 47 | 1292 | return $#{ $self } + 1; | |||||||||||||||||||
| 48 | } | ||||||||||||||||||||
| 49 | |||||||||||||||||||||
| 50 | 0 | ▶ | sub empty { | ||||||||||||||||||
|
Subroutine
empty: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||||||||||
| 51 | 0 | my $self = shift(); | |||||||||||||||||||
| 52 | |||||||||||||||||||||
| 53 | 0 | ▶ | if($self->count() == 0) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 54 | 0 | return 1; | |||||||||||||||||||
| 55 | } | ||||||||||||||||||||
| 56 | |||||||||||||||||||||
| 57 | 0 | return 0; | |||||||||||||||||||
| 58 | } | ||||||||||||||||||||
| 59 | |||||||||||||||||||||
| 60 | 396 | ▶ | sub pop { | ||||||||||||||||||
|
Subroutine
pop: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||
| 61 | 396 | my $self = shift(); | |||||||||||||||||||
| 62 | |||||||||||||||||||||
| 63 | 396 | return shift(@{ $self }); | |||||||||||||||||||
| 64 | } | ||||||||||||||||||||
| 65 | |||||||||||||||||||||
| 66 | 396 | ▶ | sub push { | ||||||||||||||||||
|
Subroutine
push: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||
| 67 | 396 | my $self = shift(); | |||||||||||||||||||
| 68 | |||||||||||||||||||||
| 69 | 396 | unshift(@{ $self }, shift()); | |||||||||||||||||||
| 70 | } | ||||||||||||||||||||
| 71 | |||||||||||||||||||||
| 72 | 10 | 1; | |||||||||||||||||||
| 73 | |||||||||||||||||||||
| 74 | __END__ | ||||||||||||||||||||