home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.perl
- Path: sparky!uunet!mcsun!Germany.EU.net!nixpbe!news.sni.de!neurotic!kebsch
- From: kebsch@neurotic.sni.de (Waldemar Kebsch)
- Subject: dbm problems/questions (msdos-perl).
- Message-ID: <kebsch.716557576@neurotic>
- Sender: news@nixpbe.sni.de
- Organization: Siemens Nixdorf Info.Sys. AG, Paderborn, Germany
- Date: Tue, 15 Sep 1992 11:46:16 GMT
- Lines: 61
-
- Hi,
-
- I have fetched PERL419X.ZIP from Simtel and it runs fine. Because I have
- no experience with dbm I wrote a simple example using dbmopen(), dbmclose(),
- etc.. It works fine, but the [????????.dir] file is only 0 bytes long???
-
- Here some piece of information ..
- ---------------------------------------------------------------------------
- The PERL script, I wrote ...
- ---------------------------------------------------------------------------
- # Simple dbm test (W. Kebsch)
-
- dbmopen(db, 'database', 0666);
-
- $db{'a'} = 'Data(a)';
- $db{'b'} = 'Data(b)';
- $db{'c'} = 'Data(c)';
-
- dbmclose(db);
-
- dbmopen(db, 'database', 0666);
-
- @keys = keys(%db);
- @values = values(%db);
- printf("keys=%d, values=%d\n", $#keys + 1, $#values + 1);
-
- while(($key, $value) = each(db)) {
- printf("key=%s, value=%s\n", $key, $value);
- }
-
- dbmclose(db);
- ---------------------------------------------------------------------------
- The directory before running the script ...
- ---------------------------------------------------------------------------
- PERL286 EXE 324619 23.02.92 11.20
- TDBM PL 399 15.09.92 13.29
- ---------------------------------------------------------------------------
- The output of the command: "C>PERL286 TDBM.PL"
- ---------------------------------------------------------------------------
- keys=3, values=3
- key=b, value=Data(b)
- key=a, value=Data(a)
- key=c, value=Data(c)
- ---------------------------------------------------------------------------
- The directory after running the script ...
- ---------------------------------------------------------------------------
- PERL286 EXE 324619 23.02.92 11.20
- TDBM PL 403 15.09.92 13.29
- DATABASE PAG 1560 15.09.92 13.32
- DATABASE DIR 0 15.09.92 13.32
- ---------------------------------------------------------------------------
-
- Hmm .., what's going wrong (what I am doing wrong?) ?
-
- Thanks in advance for your help!
- Waldemar
- --
- Waldemar Kebsch, c/o SIEMENS NIXDORF Informationssysteme AG, STO SI 32,
- W-4790 Paderborn, Federal Republik of Germany
- Email (USA) : kebsch.pad@sni-usa.com | Phone: (+49) 5251 835645
- Email (World): kebsch.pad@sni.de | Fax : (+49) 5251 835602
-