SPUG: Installing Crypt, not su

Matt Tucker tuck at whistlingfish.net
Fri Dec 29 03:52:00 CST 2000


-- Joe Devlin <jdevlin at stadiumdistrict.com> spake thusly:

> The use DES; is still failing, while MD5 and CBC use statements seem
> to succeed.
>
> I re-installed DES from a clean tar file.
>
> There are several DES modules floating around after the installation,
> I'm not sure which one is supposed to be referenced in @INC.
>
> I confirmed directory structure as you suggested
> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
> [myAccount at seker DES]$ pwd
> /home/a/myAccount/public_html/cgi-bin/modules/Crypt-DES-2.03/lib/site
> _perl/5.6.0/ i386-inux/auto/Crypt/DES
> [myAccount at seker DES]$ ls
> DES.bs  DES.so
>
>
> [myAccount at seker Crypt]$ pwd
> /home/a/myAccount/public_html/cgi-bin/modules/Crypt-DES-2.03/lib/site
> _perl/5.6.0/i3 86-linux/Crypt
> [myAccount at seker Crypt]$ ls
> DES.pm
> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-


>	 use lib qw(
>		
> /home/a/myAccount/public_html/cgi-bin/modules/Crypt-CBC-1.25/lib/perl
> 5/site_perl/5.005/Crypt
>	
> /home/a/myAccount/public_html/cgi-bin/modules/Crypt-DES-2.03/lib/site
> _perl/5.6.0/i386-linux/Crypt
>
> /home/a/myAccount/public_html/cgi-bin/modules/MD5-1.7/lib/perl5/site_
> perl/5.005/i386-linux
>
>		 );
>
>	 use Common;		#standard project stuff
>	 use DBI;			#datbase interface
>	 use CGI qw(:all);		#creating web pages
>	 use CGI param;
>	 use English;
>	 use diagnostics;		#verbose failure codes
>
>	
>	 use MD5;
>	 use CBC;			#to encrypt registration info
>	 use DES;

Wow. That's certainly more complicated than I'd bother with; I would just install everything in '/home/a/myAccount/lib' and do one 'use lib', but that's all you, I suppose.

As I said last time, I've noticed people doing things like:

    use lib qw(/home/tuck/lib/Crypt);
    use DES;

Which works, but is not appropiate. The proper thing to do is:

    use lib qw(/home/tuck/lib);
    use Crypt::DES;

This allows perl to find the proper auto hierarchies as well, and makes 
your code more consistent in that you do 'use Crypt::DES' and reference 
the module later as 'Crypt::DES', rather than doing 'use DES' and then later calling it 'Crypt::DES'.

To sum up, you should probably do the following:

    # Note the removal of '/Crypt' from the end of the first one
    use lib qw(
/home/a/myAccount/public_html/cgi-bin/modules/Crypt-DES-2.03/lib/\
site_perl/5.6.0/i386-linux

/home/a/myAccount/public_html/cgi-bin/modules/MD5-1.7/lib/perl5/\
site_perl/5.005/i386-linux
    );

    use Crypt::DES;  # <-- note the full name on these two
    use Crypt::CBC;
    use Digest::MD5; # <-- note the use of Digest::MD5 instead
                     #     of plain old MD5, which is deprecated

By the way, you probably shouldn't install things under directories like 'site_perl/5.6.0' unless you actually HAVE perl 5.6.0. If you do, then that's fine, otherwise you're better off matching your actual version or just not bothering with all that extra path stuff.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 232 bytes
Desc: not available
Url : http://mail.pm.org/archives/spug-list/attachments/20001229/57fa8e3e/attachment.bin


More information about the spug-list mailing list