Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Perl permissions

Status
Not open for further replies.
Jun 19, 2001
86
US
Here is my scenario:

1) I am using RedHat linux.
2) The default version of Perl is 5.6, is installed in /usr/bin, and is owned by root.
3) I have installed Perl 5.8 in /opt/perl as a user named perl.

I have the following script:

use DB_File;
$file = "/u01/app/jomarmgr/users/users";
# print out history file offsets
dbmopen(%DBM, $file, 0444) || die("$!");
while (($key,$val) = each %DBM) {
print $key, ' = ', unpack('L',$val), "\n";
}
dbmclose(%DBM);

When I use Perl 5.6 as the interpreter it works fine. When I use 5.8 as the interpreter I get a messsage that says "File exists" or "Permission denied". The permissions on the users file is 777.

What is the deal? I get the same results using tie instead of dbmopen. There appears to be an issue with permissions on the 5.8 interpreter.

I know 5.8 works because I have other scripts using it. But they are not using dbmopen.

Nathan
 
Nathan,

Could anyone else have this file open at the time?

--Paul
 
Nathan,

I would be writing to the author(s) of DB_File and telling them it doesn't work with 5.8, give them the output of perl -V and an example script that will reproduce the error in 5.8 but work in 5.6.

Mike

Want to get great answers to your Tek-Tips questions? Have a look at faq219-2884

It's like this; even samurai have teddy bears, and even teddy bears get drunk.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top