for ( 0 .. ( $offense_line_count - 1 ) ) { my $value = $offense_value_array[$_]; # next if ( !defined $value ); my $label = $offense_label_array[$_]; $title = $value if ( $label eq 'Title'); $section = $value if ( $label eq 'Section' ); $subsection = $value if ( $label eq 'Subsection' ); $class = $value if ( $label eq 'Class' ); $category = $value if ( $label eq 'Category' ); $degree = $value if ( $label eq 'Degree' ); $num_chgs = $value if ( $label eq 'CountOfCharges'); $hash{$label} = $value; print "$hash{$label}\n"; if ( $label eq 'CountOfCharges') { for (0 .. ($num_chgs - 1)) { push (@AOH, %hash); } } }
In reply to accessing elements in array of hashes by fionbarr
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |