#!/usr/local/bin/perl use strict; use warnings; use DB_File; my (%h, $k, $v); my $file = "/tmp/data_db"; # This is the problem tie %h, "DB_File", "$file", O_RDWR|O_CREAT, 0777, $DB_HASH or die "Cannot open file $file $!\n"; $h{"apple"} = "red"; $h{"orange"} = "orange"; $h{"banana"} = "yellow"; $h{"tomato"} = "red"; # code to print keys and values of hash - no problem here