1. #!/usr/bin/perl 2. 3. use strict; 4. 5. # jarcompare.pl compares two or many Jar files: 6. # jarcompare.pl file1 file2 .. 7. 8. usage() unless @ARGV > 1; 9. sub usage { print join "",<DATA>; exit; } 10. 11. my $interpreter = "aspl -groupingclass POSIX -wsname TRANSIENT -singlepass"; 12. my $s = "displayoff\n"; 13. 14. my @jars; 15. for (my $i=0; $i<@ARGV; $i++) { 16. die "CANNOT READ THE JARFILE $ARGV[$i]\n" unless -r $ARGV[$i]; 17. # adding aspl variables as jar0 jar1 .. 18. $s .= "jar$i = ggjar(jarfile,$ARGV[$i],calchksum,1,calentropy,1)\n"; 19. push(@jars,"jar$i"); 20. } 21. $s .= " 22. displayon 23. ks chksum ppdd ffl 24. gU @jars 25. sim @jars 26. "; 27. 28. open(ASPL, "| $interpreter -STDIN") or die "ERROR OPENING A PIPE TO aspl: $! \n"; 29. print ASPL $s; 30. close ASPL; 31. 32. __END__ 33. 34. jarcompare.pl must be followed by a list of jar files 35. 36. jarcompare.pl jarfile1 jarfile2 .. 37.