Re: Perl DB Question again

2001-06-21 Thread Michael Fowler
On Thu, Jun 21, 2001 at 08:48:08AM -0500, Prabhu, Vrunda P (UMC-Student) wrote: I have the following code: [snip] open Fin, mockalias; Always check your open calls: open Fin, mockalias or die(Unable to open file \mockalias\: \l$!.\n); [snip] My question is the following: When

Re: PERL DB Question

2001-06-19 Thread Vrunda Prabhu
On Tue, 19 Jun 2001 [EMAIL PROTECTED] wrote: 1) unless you have previously populated the db file, it will start off as empty. I guess, this is my most basic and pressing question. A file by the name mockalias exists which already has the usernames and e-mail addresses separated

Re: PERL DB Question

2001-06-19 Thread victor
1) unless you have previously populated the db file, it will start off as empty. I guess, this is my most basic and pressing question. A file by the name mockalias exists which already has the usernames and e-mail addresses separated by : When I use the tie command, am I

Re: PERL DB Question

2001-06-19 Thread Vrunda Prabhu
PERFECT!! Works like magic. Thank you very much Victor. On Tue, 19 Jun 2001 [EMAIL PROTECTED] wrote: 1) unless you have previously populated the db file, it will start off as empty. I guess, this is my most basic and pressing question. A file by the name mockalias

Re: PERL DB Question

2001-06-18 Thread victor
Try this instead tie %ALIAS, DB_File, $filename, O_RDWR|O_CREAT, 0644, $DB_HASH; Prabhu, Vrunda P (UMC-Student) wrote: I have an existing file, called mockalias that contains entries in the following format: username : e-mail address I want to use a hash %ALIAS to read the mockalias file

RE: PERL DB Question

2001-06-18 Thread Prabhu, Vrunda P (UMC-Student)
: '[EMAIL PROTECTED]' Sent: 6/18/01 1:29 PM Subject: Re: PERL DB Question Try this instead tie %ALIAS, DB_File, $filename, O_RDWR|O_CREAT, 0644, $DB_HASH; Prabhu, Vrunda P (UMC-Student) wrote: I have an existing file, called mockalias that contains entries in the following format: username : e-mail

Re: PERL DB Question

2001-06-18 Thread victor
; -Original Message- From: [EMAIL PROTECTED] To: Prabhu, Vrunda P (UMC-Student) Cc: '[EMAIL PROTECTED]' Sent: 6/18/01 1:29 PM Subject: Re: PERL DB Question Try this instead tie %ALIAS, DB_File, $filename, O_RDWR|O_CREAT, 0644, $DB_HASH; Prabhu, Vrunda P (UMC-Student) wrote: I have

RE: PERL DB Question

2001-06-18 Thread Prabhu, Vrunda P (UMC-Student)
; -Original Message- From: [EMAIL PROTECTED] To: Prabhu, Vrunda P (UMC-Student) Cc: '[EMAIL PROTECTED]' Sent: 6/18/01 1:29 PM Subject: Re: PERL DB Question Try this instead tie %ALIAS, DB_File, $filename, O_RDWR|O_CREAT, 0644, $DB_HASH; Prabhu, Vrunda P (UMC-Student) wrote: I

RE: Perl DB Question

2001-06-18 Thread Stephen Neu
: and may I suggest a little loop like this : : :foreach (keys %hash) :{ : print $_ :: $hash{$_}\n; :} : : which will print the content of the hash in a nice looking fashion. : I have found Data::Dumper to be excellent in printing lol's and references in a pretty fashion. use Data::Dumper;

Re: PERL DB Question

2001-06-18 Thread Michael Fowler
On Mon, Jun 18, 2001 at 01:15:44PM -0500, Prabhu, Vrunda P (UMC-Student) wrote: I have an existing file, called mockalias that contains entries in the following format: username : e-mail address I want to use a hash %ALIAS to read the mockalias file into the hash [snip] #!/usr/bin/perl