# compares two Tree::DAG Nodes and returns positive if right (second) argument is bigger sub compare_nodes { my ($compare_node, $leaf_node) = @_; my $source_OK = compare_subnet($compare_node->{'attributes'}{'source'},$leaf_node->{'attributes'}{'source'}); my $destination_OK = compare_subnet($compare_node->{'attributes'}{'destination'},$leaf_node->{'attributes'}{'destination'}); print "$compare_node->{'attributes'}{'original'} is a daughter of $leaf_node->{'attributes'}{'original'}\n\n" if ($source_OK && $destination_OK); return 1 if ($source_OK && $destination_OK); return 0; }