line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Net::Amazon::MechanicalTurk::RowData::SubroutineRowData; |
2
|
1
|
|
|
1
|
|
5
|
use strict; |
|
1
|
|
|
|
|
21
|
|
|
1
|
|
|
|
|
65
|
|
3
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
43
|
|
4
|
1
|
|
|
1
|
|
6
|
use Carp; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
91
|
|
5
|
1
|
|
|
1
|
|
6
|
use Net::Amazon::MechanicalTurk::RowData; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
320
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $VERSION = '1.00'; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
our @ISA = qw{ Net::Amazon::MechanicalTurk::RowData }; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
Net::Amazon::MechanicalTurk::RowData::SubroutineRowData->attributes(qw{ |
12
|
|
|
|
|
|
|
sub |
13
|
|
|
|
|
|
|
}); |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub init { |
16
|
1
|
|
|
1
|
0
|
2
|
my $self = shift; |
17
|
1
|
|
|
|
|
10
|
$self->setAttributes(@_); |
18
|
1
|
|
|
|
|
9
|
$self->assertRequiredAttributes(qw{ sub }); |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub each { |
22
|
1
|
|
|
1
|
0
|
10
|
my ($self, $block, @blockXArgs) = @_; |
23
|
|
|
|
|
|
|
$self->sub->(sub { |
24
|
20
|
|
|
20
|
|
701
|
my ($row) = @_; |
25
|
20
|
100
|
|
|
|
54
|
if (!$self->fieldNames) { |
26
|
1
|
50
|
|
|
|
5
|
if (!UNIVERSAL::isa($row, "HASH")) { |
27
|
0
|
|
|
|
|
0
|
Carp::croak("First item generated is not a hash."); |
28
|
|
|
|
|
|
|
} |
29
|
1
|
|
|
|
|
11
|
$self->fieldNames([sort keys(%$row)]); |
30
|
|
|
|
|
|
|
} |
31
|
20
|
|
|
|
|
42
|
$block->($self, $row, @blockXArgs); |
32
|
1
|
|
|
|
|
9
|
}); |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
return 1; |