From owner-freebsd-questions Wed May 15 5:48:40 2002 Delivered-To: freebsd-questions@freebsd.org Received: from icarus.slightlystrange.org (icarus.slightlystrange.org [62.190.193.173]) by hub.freebsd.org (Postfix) with ESMTP id CC56537B408 for ; Wed, 15 May 2002 05:48:34 -0700 (PDT) Received: from root by icarus.slightlystrange.org with local (Exim 3.12 #1 (Debian)) id 177yCn-0003uo-00 for ; Wed, 15 May 2002 13:48:33 +0100 Date: Wed, 15 May 2002 13:48:33 +0100 From: root 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> Reply-To: dan@slightlystrange.org Mail-Followup-To: freebsd-questions@FreeBSD.ORG References: <20020515122816.59761.qmail@web13609.mail.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20020515122816.59761.qmail@web13609.mail.yahoo.com> User-Agent: Mutt/1.3.27i Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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