Hi everyone,


I have two questions:

1. I'm trying to establish a dbm file using the DB_File module. It works 
fine locally, i.e. using Activestate Perl on win32, but produces the 
following error message when it attempts to run on the server 
(Apache/Perl5.xx).  The error message is: 'Inappropriate file type or 
format'. This occurs when the script attempts the tie. Any ideas?  The 
relevant part of the code is:

use DB_File;
use Fcntl;

$name = 'Rod';
tie(%pword, DB_File, './security/cmtpwordtest', O_RDWR|O_CREAT, 0666, 
$DB_HASH) || &reportError("F0", "opening cmtpw dbm");

        if ($pword{$name}) {
                @custRec = split (/&/, $pword{$name});
                $password = $custRec[0];
                $course = $custRec[1];

                .
                .
                .
                etc.
                etc.
                .
                .
                .

        }


untie %pword;
}


sub reportError {

...........error handling .............

}


2. If I can get this to work I need to lock the file. I understand that to 
use the 'fd method' is risky. The server does not have the DB_File::Lock 
module, if I try to use this it fails at compile time, and I have no 
control over what software is installed by the ISP. Again any advice would 
be gratefully received.

I'm quite happy to use some other dbm system, SDBM would be nice as I know 
that it works ok on the server, but I need some advice on locking such a 
file safely.

As you can guess I'm fairly new to Perl and CGI so thanks in advance for 
what is probably a trivial question.


Rod Fletcher

_______________________________________________
Perl-Win32-Web mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-web

Reply via email to