Key: node0 Value: servername0 Key: node0wwn0 Value: servername0wwn0 ... #### foreach my $key (sort keys %$ref) { if ($key ne "Server") { print $key .":" . " " . $ref->{$key} . "\n"; } ### Search the hash for cluster nodes. ### If they exist, perform operations ### Regex looks for the node.* keys, which indicates a cluster node. ### If there's no cluster, there won't be any node.* keys. if ($key =~ m/node.*$/) { print "We have a cluster! Here are the entries: " .$key. ":" . $ref->{$key}. "\n"; } if ($key =~ m/node[0-9]/) { print $key . ":" . $ref->{$key}. "\n"; } }