in reply to Help match relevant data from three data structures
If you really want to do this in pure Perl, here are some tips:
Rather than having space- or pipe-separated string lists in your data structures, use array refs instead, as in:
$country_data->{WORLDS}{Region_code} = [ split /\|/, 'ARG|AU|BELG|BRAZ +|CAN|...' ];
Write a lot of intermediate functions like get_exchangetags_from_countrycode() and is_country_in_region() and write your higher-level routine in terms of these, rather than making one monolithic routine which tweaks all your data structures directly. This is called 'abstraction', and it not only frees you to think at a higher level without worrying about lower-level details, it is a godsend should you ever have to change the layout of your data structures.
|
|---|