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 followi
Victor had graciously answered some of my questions earlier about using
DB_File in a perl CGI. I am now wondering about the following:
I have the following code:
**
$filename="./mockalias.db";
tie %ALIAS, 'DB_File', "$filename", O_RDWR|O_CREAT, 0644, $DB_H
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
> > > 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
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
>
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/per
> 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 not pulli
: 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;
$DB_HASH;
> $key = "vrunda";
> if (exists $ALIAS{$key})
> {
> print "$key has value $ALIAS{$key}\n";
> }
> print "$ALIAS";
> untie %ALIAS;
>
> -----Original Message-
> From: [EMAIL PROTECTED]
> To: Prabhu, Vrunda P (UMC-Student)
&
; $key = "vrunda";
> if (exists $ALIAS{$key})
> {
> print "$key has value $ALIAS{$key}\n";
> }
> print "$ALIAS";
> untie %ALIAS;
>
> -----Original Message-
> From: [EMAIL PROTECTED]
> To: Prabhu, Vrunda P (UMC-Student)
> Cc:
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-Stud
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 mock
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, and
then be able to delete,
update, add entries to this hash. When I run the following code, it tells
me that t
13 matches
Mail list logo