fx has asked for the wisdom of the Perl Monks concerning the following question:

Hi there,

I am trying to install MD5.pm as I need to be able to use MD5; in one of my programs. However, I can't seem to seem to find what I should be downloading and installing.

Looking on CPAN I see Crypt-HCE_MD5-0.60, Digest-Perl-MD5-1.5 and Digest-MD5-2.16.

Now I remember from doing this before that it's not Crypt-HCE_MD5, but Digest-Perl-MD5 has apparently given me .../site_perl/5.6.1/Digest/Perl/MD5.pm and Digest-MD5 has apparently given me .../site_perl/5.6.1/i686-linux-thread/Digest/MD5.pm but nowhere do I have just MD5.pm in a directory which is by default part of @INC.

What am I missing here? <pfx

Replies are listed 'Best First'.
Re: Trying to install MD5.pm
by ducky (Scribe) on Sep 13, 2001 at 02:25 UTC

    Digest::MD5 is probably what you're looking for. Digest::Perl::MD5 is the all perl implementation where as the other is a C interface. If you do have access to a C compiler I'd suggest using Digest::MD5 instead.

    -Ducky

Re: Trying to install MD5.pm
by blakem (Monsignor) on Sep 13, 2001 at 02:26 UTC
    MD5.pm is simply a wrapper for Digest::MD5 on my machine... Looks like it is there solely for backward compatability. You could just change your code to call Digest::MD5 if its not too much trouble. Otherwise, here is the file /usr/lib/perl5/site_perl/5.6.0/i386-linux/MD5.pm on my machine. Perhaps it will work for you as well.
    package MD5; # legacy stuff use strict; use vars qw($VERSION @ISA); $VERSION = '2.01'; # $Date: 1999/08/05 23:17:54 $ require Digest::MD5; @ISA=qw(Digest::MD5); sub hash { shift->new->add(@_)->digest; } sub hexhash { shift->new->add(@_)->hexdigest; } 1; __END__ =head1 NAME MD5 - Perl interface to the MD5 Message-Digest Algorithm =head1 SYNOPSIS use MD5; $context = new MD5; $context->reset(); $context->add(LIST); $context->addfile(HANDLE); $digest = $context->digest(); $string = $context->hexdigest(); $digest = MD5->hash(SCALAR); $string = MD5->hexhash(SCALAR); =head1 DESCRIPTION The C<MD5> module is B<depreciated>. Use C<Digest::MD5> instead. The current C<MD5> module is just a wrapper around the C<Digest::MD5> module. It is provided so that legacy code that rely on the old interface still work and get the speed benefit of the new module. In addition to the methods provided for C<Digest::MD5> objects, this module provide the class methods MD5->hash() and MD5->hexhash() that basically do the same as the md5() and md5_hex() functions provided by C<Digest::MD5>. =head1 SEE ALSO L<Digest::MD5> =cut

    -Blake

(ichimunki) Re: Trying to install MD5.pm
by ichimunki (Priest) on Sep 13, 2001 at 02:31 UTC
    Consider using
    perl -MCPAN -e "shell" > install Digest::MD5
    to install modules. It will make your life easier (if you aren't already doing that, that is).

    Digest::MD5 is the go-forward standard module to be included with your perl distribution (if 5.7 development is any indication). If your program is already written you should be able to install the plain old MD5 module as well, it does show up on search.cpan.org search for "md5".