mmartin has asked for the wisdom of the Perl Monks concerning the following question:
### I'm using 5 separate arrays but for the sake of space I'll just do + 3 here... $first[0][0] = "111" $first[0][1] = "on" $first[1][0] = "222" $first[1][1] = "off" $first[2][0] = "333" $first[2][1] = "null" ...etc... ############################ $second[0][0] = "111" $second[0][1] = "10.1.1.1" $second[1][0] = "222" $second[1][1] = "12.1.1.1" $second[2][0] = "333" $second[2][1] = "13.1.1.1" ...etc... ############################ $third[0][0] = "111" $third[0][1] = "12.1(SAG1)" $third[1][0] = "222" $third[1][1] = "12.4(FCL5)" $third[2][0] = "333" $third[2][1] = "12.1(5)" ...etc... ############################ ### Then have a hash with all the values combined. # i.e. the hash should look something like this after a 'Data::Dump': #--------- %all_data ---------# VAR1 = '111' => "on", => "10.1.1.1", => "12.1(SAG1)"; VAR2 = '222' => "off", => "12.1.1.1", => "12.4(FCL5)"; VAR3 = '333' => "null", => "13.1.1.1", => "12.1(5)";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Assign 2D-Arrays to a hash using a key
by aaron_baugher (Curate) on Feb 20, 2012 at 23:15 UTC | |
by mmartin (Monk) on Feb 21, 2012 at 14:59 UTC | |
by aaron_baugher (Curate) on Feb 22, 2012 at 01:35 UTC | |
|
Re: Assign 2D-Arrays to a hash using a key
by Anonymous Monk on Feb 21, 2012 at 00:44 UTC | |
|
Re: Assign 2D-Arrays to a hash using a key
by mmartin (Monk) on Feb 21, 2012 at 16:59 UTC |