line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package App::Sets::Iterator; |
2
|
|
|
|
|
|
|
$App::Sets::Iterator::VERSION = '0.978'; |
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
5
|
3
|
|
|
3
|
|
22
|
use strict; |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
94
|
|
6
|
3
|
|
|
3
|
|
17
|
use warnings; |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
642
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
# ABSTRACT: convenience iterator |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub new { |
11
|
192
|
|
|
192
|
0
|
866
|
my ($package, $it) = @_; |
12
|
192
|
|
|
|
|
3581
|
return bless {it => $it}, $package; |
13
|
|
|
|
|
|
|
} |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub head { |
16
|
3176
|
|
|
3176
|
0
|
4302
|
my ($self) = @_; |
17
|
3176
|
100
|
|
|
|
7784
|
return exists $self->{head} ? $self->{head} : $self->next(); |
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub next { |
21
|
2196
|
|
|
2196
|
0
|
3120
|
my ($self) = @_; |
22
|
2196
|
|
|
|
|
3926
|
return $self->{head} = $self->{it}->(); |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub drop { |
26
|
2004
|
|
|
2004
|
0
|
3363
|
my ($self) = @_; |
27
|
2004
|
|
|
|
|
2988
|
my $retval = $self->head(); |
28
|
2004
|
|
|
|
|
4074
|
$self->next(); |
29
|
2004
|
|
|
|
|
5469
|
return $retval; |
30
|
|
|
|
|
|
|
} ## end sub drop |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
1; |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
__END__ |