in reply to Re^3: If Statements and Regular Expressions
in thread If Statements and Regular Expressions

Whether the code becomes clearer when using a big hash is subjective. In your example, you got away by not having to use a different order of the fields than you define, but the original code doesn't have that luxery, as the output has the fields in a different order than the input.

Which means, you either have to use string literals as key names or put the field names into separate variables. The former loses you some of the benefits of using 'use strict' as misspellings in field names aren't found by the compiler (and not even by the runtime, 'use warnings' won't help you either). In the latter case, you're just shifting what you are trying to avoid. There's little difference in:

my %big_hash; my $field_name1 = "field_name1"; my $field_name2 = "field_name2"; ... $big_hash{$key}{$field_name1} $big_hash{$key}{$field_name2} ...
or
my %field_name1; my %field_name2; ... $field_name1{$key} $field_name2{$key}
I don't want to dogma "always group in a big hash instead of using parallel datastructures", nor the opposite. There are pros and cons.