in reply to Re^3: If Statements and Regular Expressions
in thread If Statements and Regular Expressions
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:
ormy %big_hash; my $field_name1 = "field_name1"; my $field_name2 = "field_name2"; ... $big_hash{$key}{$field_name1} $big_hash{$key}{$field_name2} ...
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.my %field_name1; my %field_name2; ... $field_name1{$key} $field_name2{$key}
|
|---|