SPUG: Installing Crypt, not su

Joe Devlin jdevlin at stadiumdistrict.com
Fri Dec 29 03:29:44 CST 2000


Matt,
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                 
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-


Session follows:
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
[myAccount at seker cgi-bin]$ ./seminars.pl -c
Uncaught exception from user code:
        Uncaught exception from user code:
        Uncaught exception from user code:
        Can't locate loadable object for module Crypt::DES in @INC (@INC contain
s: /home/a/myAccount/public_html/cgi-bin/modules/Crypt-CBC-1.25/lib/perl5/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/l
ib/perl5/site_perl/5.005/i386-linux /usr/lib/perl5/5.6.0/i386-linux /usr/lib/per
l5/5.6.0 /usr/lib/perl5/site_perl/5.6.0/i386-linux /usr/lib/perl5/site_perl/5.6.
0 /usr/lib/perl5/site_perl .) ......
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
End Session


<snip code>

	use lib qw(
		
/home/a/myAccount/public_html/cgi-bin/modules/Crypt-CBC-1.25/lib/perl5/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;


	use strict;			#must declare global variables
					#here are the globals
	use vars qw( $action $item $dummy $mstate $i $n %form_data
			$form_data $document_root %fields $path
			$filetoopen $dsn $user $password $sub_dir
                        $sth $dbh);

</snip code>





----------
From: 	Matt Tucker[SMTP:tuck at whistlingfish.net]
Sent: 	Monday, December 18, 2000 11:46 PM
To: 	Joe Devlin
Cc: 	'spug-list at pm.org'
Subject: 	Re: SPUG: Installing Crypt, not su

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

> The latest advice by the system administrators is that I should copy
> the modules from the install directory into myAccount/cgi-bin
> directory.  This has not worked properly.

You shouldn't need to do this if you have a proper 'use lib' line in your script. Ie:

use lib '/home/a/myAccount/lib';
use Crypt::DES;
...

> Does anyone have a suggestion about what next steps I should try?

If you're going to manually install Perl modules, you should do it properly. Maintain the complete structure, and copy the requisite shared libraries. Shared libraries are kept in a directory called 'auto' with a directory structure that mirrors that of the module loading the shared library. For Crypt::DES, you should have:

Crypt/
Crypt/DES.pm
auto/
auto/Crypt/
auto/Crypt/DES/
auto/Crypt/DES/DES.bs
auto/Crypt/DES/DES.so

All this stuff could either go in cgi-bin or in /home/a/myAccount/lib, depending on how you want things set up. Just be sure to use the proper 
'use lib' directive (if it's not the same directory that contains the script), and provide the correct structure.


> line 62 of the code is
>
>	 use CBC;
>	 use DES;

This should be:

    use Crypt::CBC;
    use Crypt::DES;

...with CBC.pm and DES.pm placed in a directory called 'Crypt'. It's not absolutely necessary to maintain the mapping between filename and module, but it helps keep things from being confusing.



 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
     POST TO: spug-list at pm.org       PROBLEMS: owner-spug-list at pm.org
      Subscriptions; Email to majordomo at pm.org:  ACTION  LIST  EMAIL
  Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address
 For daily traffic, use spug-list for LIST ;  for weekly, spug-list-digest
  Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/





More information about the spug-list mailing list