87 |
@{@{$out->{atoms}}[$index]}{keys(%args)} = values(%args) |
@{@{$out->{atoms}}[$index]}{keys(%args)} = values(%args) |
88 |
), |
), |
89 |
find_atom_pos => q( |
find_atom_pos => q( |
90 |
my $i = 0; |
$first_atom ||= 0; |
91 |
|
$last_atom ||= @{$out->{atoms}}-1; |
92 |
my @res; |
my @res; |
93 |
foreach my $atom (@{$out->{atoms}}) { |
foreach my $pos ($first_atom..$last_atom) { |
94 |
|
my $atom = $out->{atoms}->[$pos]; |
95 |
my $flag = 1; |
my $flag = 1; |
96 |
foreach (keys(%args)) { |
foreach (keys(%args)) { |
97 |
if ($_ eq "sections") { |
if ($_ eq 'sections') { |
98 |
$atom->{sections}[0]{name} eq $args{sections}->[0]{name} or $flag = 0; |
$atom->{sections}[0]{name} eq $args{sections}->[0]{name} or $flag = 0; |
99 |
} else { |
} else { |
100 |
$atom->{$_} eq $args{$_} or $flag = 0; |
$atom->{$_} eq $args{$_} or $flag = 0; |
101 |
} |
} |
102 |
} |
} |
103 |
$flag and push(@res, $i); |
$flag and push(@res, $pos); |
|
$i++; |
|
104 |
} |
} |
105 |
wantarray ? @res : $res[-1]; |
wantarray ? @res : $res[-1]; |
106 |
), |
), |