@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 }