| 1 | package Catmandu::MultiIterator; | ||||||||||
| 2 | |||||||||||
| 3 | 2 | ▶ | use Catmandu::Sane; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | |||||||||||
| 5 | 2 | our $VERSION = '1.2025'; | |||||||||
| 6 | |||||||||||
| 7 | 2 | ▶ | use Role::Tiny::With; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 8 | 2 | ▶ | use namespace::clean; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 9 | |||||||||||
| 10 | 2 | with 'Catmandu::Iterable'; | |||||||||
| 11 | |||||||||||
| 12 | 1 | ▶ | sub new { | ||||||||
|
Subroutine
new: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 13 | 1 | my ($class, @iterators) = @_; | |||||||||
| 14 | 1 | my $self = \@iterators; | |||||||||
| 15 | 1 | bless $self, $class; | |||||||||
| 16 | } | ||||||||||
| 17 | |||||||||||
| 18 | 1 | ▶ | sub generator { | ||||||||
|
Subroutine
generator: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 19 | 1 | my ($self) = @_; | |||||||||
| 20 | 7 | ▶ | sub { | ||||||||
|
Subroutine
__ANON__: called CC=3 SCAR=11.0
| |||||||||||
| 21 | 7 | state $generators = [map {$_->generator} @$self]; | |||||||||
| 22 | 7 | ▶ | while (@$generators) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 23 | 8 | my $data = $generators->[0]->(); | |||||||||
| 24 | 8 | ▶ | return $data if defined $data; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 25 | 2 | shift @$generators; | |||||||||
| 26 | } | ||||||||||
| 27 | 1 | return; | |||||||||
| 28 | 1 | }; | |||||||||
| 29 | } | ||||||||||
| 30 | |||||||||||
| 31 | 2 | 1; | |||||||||
| 32 | |||||||||||
| 33 | __END__ | ||||||||||