Permission denied with Perl Storable

458 Views Asked by At

I am trying to persist data across a perl CGI application (when a submit button is clicked). But the following code:

use Storable;
my %hash = ('1'=>'a','2'=>'b','3'=>'c');
store \%hash, 'handle';

returns:

Error executing run mode 'Admin Page': can't create handle: Permission denied at Main.pm line 76

How do I give the script permission to save the data?

1

There are 1 best solutions below

1
On BEST ANSWER

Sounds like the user the web server runs as does not have permissions to write to the directory. As a test, try store \%hash, '/tmp/handle';, and if that works, you'll need to get directory permissions sorted where you want to save the data.