Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 15 May 2002 13:48:33 +0100
From:      root <dan@slightlystrange.org>
To:        freebsd-questions@FreeBSD.ORG
Subject:   Re: Help compiling a perl program - some problems related to MD5.pm
Message-ID:  <20020515124833.GA13511@icarus.slightlystrange.org>
In-Reply-To: <20020515122816.59761.qmail@web13609.mail.yahoo.com>
References:  <20020515122816.59761.qmail@web13609.mail.yahoo.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, May 15, 2002 at 05:28:16AM -0700, Roberto Armenteros wrote:
> I am trying to run a perl program to check for file
> checksums and I havent been able to run it in my
> computer. "The program runs perfectly at another
> computer running netbsd." First time i tried to run
> the program this was the error i got:
> bash-2.05a$ perl checksum.pl /etc
> Can't locate MD5.pm in @INC (@INC contains:
> /usr/libdata/perl/5.00503/mach
> /usr/libdata/perl/5.00503
> /usr/local/lib/perl5/site_perl/5.005/i386-freebsd
> /usr/local/lib/perl5/site_perl/5.005 .) at checksum.pl
> line 1.
> BEGIN failed--compilation aborted at checksum.pl line
> 1.
> 
> What i understand from here is that it cant find
> MD5.pm, then i run the comand locate MD5.pm and I
> found it in the following directory:
> bash-2.05a$ locate MD5
> /usr/local/lib/perl5/site_perl/5.005/i386-freebsd/Digest/MD5.pm

That is the Digest::MD5 module, not MD5 proper - two different things.

> 
> My newbie mind suggested to move the MD5.pm files to
> one of those folders specified on the first error "in
> &INC" and then when i tried to run the program the
> error was a different one, which is:

EEK!  Don't do that!  Perl allows you to modify the contents of the
@INC array so you don't need to move library files around, and so you
can specify your own library directories.  Take a look at the 
documentation for the "use lib" pragma.

> 
> bash-2.05a$ perl checksum.pl /etc
> Can't locate object method "new" via package "MD5" at
> checksum.pl line 3. In other words, it does excecute
> the following marked line in the code:
> 
> use MD5;
> require 'find.pl';
> $md5 = new MD5; ## <----- error here

Now you have moved Digest::MD5, perl is finding what it thinks is MD5,
but cannot then find the new() routine that checksum.pl needs.

> 
> Please, what's going on here!!! The code runs
> perfectly in another computer. Dont i have MD5 support
> properly installed? Does the fact that i found MD5.pm
> in the following location mean that it is properly
> installed?
> /usr/local/lib/perl5/site_perl/5.005/i386-freebsd/Digest/MD5.pm

Digest::MD5 is properly inqtalled, but not MD5.  You will find it in
the ports tres (/usr/ports/security/p5-MD5/) or you can get it using 
CPAN.  Move anything to do with Digest::MD5 back to where it was, 
then install MD5 and try checksum.pl again.  An easy way to see if a
module you need is installed in the standard libraries is to run
 perl -e 'use ModuleName;'

at your shell prompt and see if you get any errors.


HTH

Dan

> 
> I am quite sure that the package p5-Digest-MD5.2.16 is
> installed because it appears so when i run sysinstall
> 
> If u need anything else, please let me know
> 
> I would really appreciate any help i receive...
> 
>    Thanks a lot... Rob...

-- 
Daniel Bye

PGP Key: ftp://ftp.slightlystrange.org/pgpkey/dan.asc
PGP Key fingerprint: 3D73 AF47 D448 C5CA 88B4 0DCF 849C 1C33 3C48 2CDC
                                                                     _
                                              ASCII ribbon campaign ( )
                                         - against HTML, vCards and  X
                                - proprietary attachments in e-mail / \

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020515124833.GA13511>