#!/usr/bin/perl # Bryan Bishop 2009-01-20 # see notes.txt # input: graphID graphID if ($#ARGV != 1) { print "useage: graphID graphID\n\nHow many rules were applied in common between the two graphs?\n\n"; } open(FIRST, "; close(FIRST); open(SECOND,"; close(SECOND); my $totalInCommon=0; @doneNumbers = (); foreach my $num (@rules1) { $doNotGo = 0; foreach my $testn (@doneNumbers) { if ($num eq $testn) { $doNotGo = 1; } } if ($doNotGo == 0) { foreach my $num2 (@rules2) { $doNotGo2 = 0; foreach my $testn (@doneNumbers) { if ($num2 eq $testn) { $doNotGo2 = 1; } } if($doNotGo2 == 0) { if($num eq $num2) { $totalInCommon += 1; push(@doneNumbers, $num); push(@doneNumbers, $num2); } } } } } print $totalInCommon, "\n";