in reply to multidimensional hash of array

There's two ways that you can do this in perl:

One, create a hash of hashs of arrays:

my %hash = ( network_type_1 => { conn_type_1 => [ 1 ], conn_type_2 => [ 2 ] }, network_type_2 => { conn_type_1 => [ 3 ], conn_type_2 => [ 4 ] } ); # To get at the elements: print $hash{ $network }->{ $connection }->[ $pos ];
Alternatively, if there is a way to delimit the network and connection type into one string, you can get away with just a hash of arrays:
my %hash = ( 'network-type_1|conn_type_1' => [ 1 ], 'network-type_1|conn_type_2' => [ 2 ], 'network-type_2|conn_type_1' => [ 3 ], 'network-type_2|conn_type_2' => [ 4 ] ); print $hash{ "$network|$conn" }->[ $pos ];
While the latter is probably easier to type out, the former case is easier to understand.


Dr. Michael K. Neylon - mneylon-pm@masemware.com || "You've left the lens cap of your mind on again, Pinky" - The Brain