Hi, I'm new to the list. Thanks everyone for having/doing this. I want to use PERL to work with a database, but I can't seem to get PERL to open the databases on my computer. I've been learning from Paul Hoffman's PERL for Dummies (3rd edition). If I understand the book correctly, the code below should open my database into an associative array, which I could then manipulate. e.g. In the program below I try to print out the keys, print out an individual item, and change an individual item. None of those 3 things happen though. The program also doesn't die, nor do I get an error message. One thing it does execute for sure is the last line - printing out a zero. That and the fact that when I "-w" the program it tells me I'm using an uninitialized value in line 7 seem to indicate that the database simply never opens. Why not? By the way, I've tried various formulations of the second part of the argument to dbmopen: with and without quotes, with and without file extensions, having just the file name vs. specifying the whole path (like C:/My Documents). Nothing works. But every time I run it, the computer creates two files. Their names are the file name I put in the argument to dbmopen, plus .dir for one, and .pag for the other. My guess is that PERL doesn't handle the types of databases I have. I have databases with the extensions .wdb, .dbf, and .mdb. Am I on the right track? What's going on here? Thank you very much, Fred Kittelmann %A = (); dbmopen(%A, "hOURSexperim.dbf", 0600) or die "Not gonna open it.\n"; @AllKeys = keys(%A); foreach $TheKey (@AllKeys) {print "$TheKey is the key for $A{$TheKey}\n"} $A[0][1] = "red"; print $A[5][0]; print scalar(%A);
Fred Kittelmann hOURS 215-551-1490 www.hoursystem.net --------------------------------- Yahoo! Messenger with Voice. Make PC-to-Phone Calls to the US (and 30+ countries) for 2ยข/min or less.