Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Upon reading a file I need to compare 2 vaules for example Network and connection type.
If these values do not exist create the new values and store the trailing data with them.
I currently have the following which works with only one key pair, but it is over writing the previous data because I am only comparing one field:
But I need to compare and store 2 results.@str = qw( 7 house network_name 4 6); if($myhash {$str[2]}}){ #if found // if netowrk_name is found increment the values of [3] and [4] } else{ //must be new so ad new data to hash }
I need to store and compare [0] and [2] and then have that array of data behind it.
Can someone shed some light on this for me?
thanks,
Kev
Edit by tye
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: multidimensional hash of array
by Masem (Monsignor) on May 31, 2001 at 19:12 UTC | |
|
Re: multidimensional hash of array
by bikeNomad (Priest) on May 31, 2001 at 19:17 UTC |