# $Id: DIFF,v 4.8 2002/03/27 13:56:40 katie Exp $ #!/usr/local/bin/perl $from = $ARGV[0]; $to = $ARGV[1]; &sort_net_list($from, "/tmp/$from.$$"); &sort_net_list($to, "/tmp/$to.$$"); system "diff -b /tmp/$from.$$ /tmp/$to.$$"; unlink "/tmp/$from.$$"; unlink "/tmp/$to.$$"; exit; sub sort_net_list { local ($from, $to) = (@_); local ($list) = 0; local (@list) = (); open(F, "$from"); open(T, ">$to"); while () { $list || print T; if (/^import/) { $list = 1; @list = (); next; } if (/^\};/) { $list = 0; print T sort @list; print T; next; } if ($list) { push(@list, $_); } } close F; close T; }