File Coverage

blib/lib/Net/BGP/ASPath/AS_SEQUENCE.pm
Criterion Covered Total %
statement 18 22 81.8
branch n/a
condition n/a
subroutine 6 8 75.0
pod 0 7 0.0
total 24 37 64.8


line stmt bran cond sub pod time code
1             #!/usr/bin/perl
2              
3             package Net::BGP::ASPath::AS_SEQUENCE;
4              
5 7     7   83 use strict;
  7         14  
  7         1659  
6              
7             ## Inheritance and Versioning ##
8              
9             @Net::BGP::ASPath::AS_SEQUENCE::ISA = qw( Net::BGP::ASPath::AS );
10             our $VERSION = '0.17';
11              
12             sub type {
13 18     18 0 36 return 2;
14             }
15              
16             sub length {
17 64     64 0 99 my $this = shift;
18 64         81 return scalar @{$this};
  64         223  
19             }
20              
21 0     0 0 0 sub asstring { as_string(@_) }
22              
23             sub as_string {
24 564     564 0 748 my $this = shift;
25 564         733 return join(' ', @{$this});
  564         2884  
26             }
27              
28             sub asarray {
29 60     60 0 104 my $this = shift;
30 60         76 return [ @{$this} ]; # Unblessed version of list!
  60         297  
31             }
32              
33             sub count {
34 0     0 0 0 my $this = shift;
35              
36 0         0 return scalar(@{$this});
  0         0  
37             }
38              
39             sub remove_tail {
40 3     3 0 11 my ($this, $cnt) = @_;
41              
42 3         7 while ($cnt-- > 0) {
43 3         4 pop @{$this};
  3         8  
44             }
45              
46 3         14 return $this;
47             }
48              
49             1;
50