kiat has asked for the wisdom of the Perl Monks concerning the following question:
What puzzled me is the line my $file = "/tmp/data_db";There's no directory 'tmp' in the server and I've no idea where the database file 'data_db' is called. When I changed the directory 'tmp' to, say, 'data', the script died. Am I missing something? What's so special about 'tmp'? Why does the script work only with 'tmp' as the directory?#!/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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: DB_File - help
by PodMaster (Abbot) on Nov 24, 2002 at 15:01 UTC | |
by kiat (Vicar) on Nov 24, 2002 at 15:30 UTC |