talk2kvj has asked for the wisdom of the Perl Monks concerning the following question:
if the commented line is uncommented. The output isdbmopen(%TEST, "/home/lab/access.db", 0666); #$TEST{'test_key'} = pack 'L', int(rand 2**32); while (($key,$val) = each %TEST) { print $key, ' = ', unpack('L',$val), "\n"; print "test2"; }
if the line 2 line is not present, it shows nothing. its not entering the while loop. as if the db file is empty. but it is not. file permissions, path etc are ok. the file access.db was created by an other person, one year back, on a mandrake7 machine, using db1.x, DB_File1.808 and perl5. right now, I use db4.x, DB_File1.808 and perl5.8.1. Thanks in advance UPDATE : Hi Dave, thanks for your suggestion, I already tried that and the message in the Die is not printed. So i guess it opens the file and it doesn't find any keys, so it wouldnt enter the while loop. I donno if I'm correct. I read the link that you sent me about dbmopen, but the problem is, I already have an existing 1500 line script that uses the above methos instead of "tie". It will be a lot easier for me to get this one working than changin the entire script. Thank youtest_key = 2412538716 test2
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: dbmopen not opening a db file
by davido (Cardinal) on Jun 11, 2004 at 00:13 UTC | |
|
Re: dbmopen not opening a db file
by tilly (Archbishop) on Jun 13, 2004 at 01:51 UTC |