I'm trying to use a text type DBM file but can't extract the values from the keys. I'm getting a message in the browser that says "Can't open english.db:Permission denied". I did alot of searching on this one to no avail.
Script looks like this:
#!/usr/bin/perl -w
use strict;
use CGI;
use CGI::Carp qw ( fatalsToBrowser );
use DB_File;
use Fcntl;
print"Content-Type:text/html\n\n";
my(%hexcodes,$dbm,%HASH,%hash,$red);
my $dbm="colors.db";
tie (%HASH, "DB_File", $dbm)or die "Can't open $dbm:$!\n";
my $red=$hexcodes{'red'};
print"$red";
untie %hash;
colors.db looks like this(separate file)I tried using the .txt extension but getting the same results.
%hexcodes('red' => 'ff0000',
'black' => '000000',
'white' => 'ffffff'
)