Re: help accessing NDBM database files

2007-02-21 Thread Jay Savage
On 2/21/07, RICHARD FERNANDEZ <[EMAIL PROTECTED]> wrote: > Probably rfernandez is not a valid key in the database file. Try this: > > tie my %db, 'NDBM_File', 'aliases', O_RDWR, 0644; > > while (my ($key, $value) = each %db) { > print "$key => $value\n"; > } > > untie

Re: help accessing NDBM database files

2007-02-21 Thread Mumia W.
On 02/21/2007 03:49 PM, RICHARD FERNANDEZ wrote: Probably rfernandez is not a valid key in the database file. Try this: tie my %db, 'NDBM_File', 'aliases', O_RDWR, 0644; while (my ($key, $value) = each %db) { print "$key => $value\n"; } untie %db; On my system, th

RE: help accessing NDBM database files

2007-02-21 Thread RICHARD FERNANDEZ
> Probably rfernandez is not a valid key in the database file. Try this: > > tie my %db, 'NDBM_File', 'aliases', O_RDWR, 0644; > > while (my ($key, $value) = each %db) { > print "$key => $value\n"; > } > > untie %db; > > On my system, this code works with a custom a

Re: help accessing NDBM database files

2007-02-21 Thread Mumia W.
On 02/21/2007 10:27 AM, RICHARD FERNANDEZ wrote: Hi folks, I'm working on a script in which I want to access NDBM files directly. I'm using the unix aliases file(s) for testing, but I intend to use this code for other projects as well. I have the following files: aliases, aliases.dir, and alias

RE: help accessing NDBM database files

2007-02-21 Thread RICHARD FERNANDEZ
> That man page might be lying to you. If you have a pair of > .dir/.pag files, those are probably a DBM file, not NDBM. > Have you tried DB_File? > > Hope this helps! > > --Tom Phoenix > Stonehenge Perl Training > I substitued DB_File for NDBM_File and changed the code appropriately, but I'm

Re: help accessing NDBM database files

2007-02-21 Thread Tom Phoenix
On 2/21/07, RICHARD FERNANDEZ <[EMAIL PROTECTED]> wrote: I have the following files: aliases, aliases.dir, and aliases.pag. According to the man page for aliases, these are "ndbm files maintained by newaliases". That man page might be lying to you. If you have a pair of .dir/.pag files, those

help accessing NDBM database files

2007-02-21 Thread RICHARD FERNANDEZ
Hi folks, I'm working on a script in which I want to access NDBM files directly. I'm using the unix aliases file(s) for testing, but I intend to use this code for other projects as well. I have the following files: aliases, aliases.dir, and aliases.pag. According to the man page for aliases, thes