|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Tie Statement Dies with "Permission denied"
Why does this script always die with a "Permission denied" message?
#!/usr/bin/perl use strict; use DB_File; use vars qw(%h $k $v); print "Content-type: text/html\n\n"; tie %h, "DB_File", "fruit", O_RDWR|O_CREAT, 0777, $DB_HASH or die "Can't open 'fruit':$!\n"; . . . Please help. Thanks! |
|
#2
|
|||
|
|||
|
Well do you have permission to open 'fruit'?
![]() |
|
#3
|
|||
|
|||
|
I was told this code would create a db file, but I guess it didn't. Once I created 'fruit' with the necessary permissions, everything worked fine.
![]() |
|
#4
|
|||
|
|||
|
Does DB_File export the symbols O_CREAT and O_RDWR ? Try turning on warnings.
I'm using DB_File, but importing those symbols from Fcntl: use Fcntl qw(O_CREAT O_RDWR O_RDONLY); |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > Perl Programming > Tie Statement Dies with "Permission denied" |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|