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 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 the file
> mockalias exists, and dies.  How can I read the file into a hash and
> manipulate the entries
> of the hash?
>
>
> #!/usr/bin/perl
> use CGI ':standard';
> use DB_File;
> $filename = "mockalias";
> tie (%ALIAS, "DB_File", $filename) or
>                 die "cannot open file $filename:$!\n";
> untie %ALIAS;
>
> Thanks in advance for your time.
> Vrunda

Reply via email to