On Mon, Sep 17, 2001 at 03:43:28PM +0100, Simon Cozens wrote:
> Or you could install Digest::MD5. :) I'm not terribly amused by the dependency
> on it, but I guess that for "release" versions of Parrot, the opcode header
> and other autogenerated things will be generated before shipping; much like we
> do with embed.pl in Perl 5.

Greetings. I'm new to whole parrot experience, so pardon my ignorance.

I was just looking at those files that use Digest::MD5 and the only one
that appears to really depend on it is Parrot/Opcode.pm. assemble.pm,
disassemble.pl, and build_interp_starter.pl all "use" it but none call
any of the subroutines defined therein.

Parrot/Opcode.pm only uses Digest::MD5 for fingerprinting the opcode
file which could be done without Digest::MD5 IMHO.  For instance,
using unpack() to checksum the file.

I've attached a diff if anyone is interested.

-Scott
-- 
Jonathan Scott Duff
[EMAIL PROTECTED]
? diff.jsd
? diff.duff
Index: assemble.pl
===================================================================
RCS file: /home/perlcvs/parrot/assemble.pl,v
retrieving revision 1.24
diff -u -r1.24 assemble.pl
--- assemble.pl 2001/09/16 18:25:27     1.24
+++ assemble.pl 2001/09/17 15:36:27
@@ -5,7 +5,6 @@
 # Brian Wheeler ([EMAIL PROTECTED])
 
 use strict;
-use Digest::MD5 qw(&md5_hex);
 use Getopt::Long;
 use Parrot::Opcode;
 
Index: build_interp_starter.pl
===================================================================
RCS file: /home/perlcvs/parrot/build_interp_starter.pl,v
retrieving revision 1.6
diff -u -r1.6 build_interp_starter.pl
--- build_interp_starter.pl     2001/09/15 16:05:40     1.6
+++ build_interp_starter.pl     2001/09/17 15:36:27
@@ -1,6 +1,5 @@
 # !/usr/bin/perl -w
 use strict;
-use Digest::MD5 qw(&md5_hex);
 use Parrot::Opcode;
 
 open INTERP, "> interp_guts.h" or die "Can't open interp_guts.h, $!/$^E";
Index: disassemble.pl
===================================================================
RCS file: /home/perlcvs/parrot/disassemble.pl,v
retrieving revision 1.7
diff -u -r1.7 disassemble.pl
--- disassemble.pl      2001/09/14 18:06:10     1.7
+++ disassemble.pl      2001/09/17 15:36:27
@@ -5,7 +5,6 @@
 # Turn a parrot bytecode file into text
 
 use strict;
-use Digest::MD5 qw(&md5_hex);
 use Parrot::Opcode;
 
 my %unpack_type = (i => 'l',
Index: Parrot/Opcode.pm
===================================================================
RCS file: /home/perlcvs/parrot/Parrot/Opcode.pm,v
retrieving revision 1.4
diff -u -r1.4 Opcode.pm
--- Parrot/Opcode.pm    2001/09/16 22:05:22     1.4
+++ Parrot/Opcode.pm    2001/09/17 15:36:27
@@ -2,7 +2,6 @@
 
 use strict;
 use Symbol;
-use Digest::MD5 qw(&md5_hex);
 
 my %opcode;
 my $fingerprint;
@@ -13,10 +12,9 @@
     my $fh = gensym;
     open $fh, $file or die "$file: $!\n";
 
-    my $md5 = Digest::MD5->new;
     my $count = 1;
     while (<$fh>) {
-       $md5->add($_);
+       $fingerprint += unpack('%32C*', $_);
 
        s/#.*//;
        s/^\s+//;
@@ -41,8 +39,6 @@
        my $num_n = () = grep {/n/} @params;
        $opcode{$name}{RETURN_OFFSET} = 1 + $num_i + $num_n * 2;
     }
-
-    $fingerprint = $md5->hexdigest;
 }
 
 sub read_ops {

Reply via email to