This file is indexed.

/usr/share/perl5/Catmandu/Iterator.pm is in libcatmandu-perl 0.9206-1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
package Catmandu::Iterator;

=head1 NAME

Catmandu::Iterator - Base class for all Catmandu iterators

=head1 SYNOPSIS

  package My::MockIterator;

  use Moo;
  
  with 'Catmandu::Iterable';

  sub generator {
    sub {
        # Generator some random data
        +{ random => rand };
    }
  } 

  package main;
 
  my $it = My::MockIterator->new;

  my first = $it->first;

  $it->each(sub {
  my $item = shift;

  print $item->{random} , "\n";
  });

  my $it2 = $it->map(sub { shift->{random} * 2 });

=head1 METHODS

=head2 generator

Should return a closure that generates one Perl hash.

=head1 INHERIT

If you provide a generator, then the class will generator all methods from L<Catmandu::Iterable>.

=head1 SEE ALSO

L<Catmandu::Iterable>

=cut

use namespace::clean;
use Catmandu::Sane;
use Role::Tiny::With;

with 'Catmandu::Iterable';

sub new {
    bless $_[1], $_[0];
}

sub generator {
    goto &{$_[0]};
}

1;