mulander has asked for the wisdom of the Perl Monks concerning the following question:
I would like to store the data using dbmopen so I tried:#!/usr/bin/perl use warnings; use strict; my %users; $users{mulander}->{email} = 'netprobe@gmail.com'; print "$users{mulander}->{email}\n";
But when I do that, I keep getting this error:#!/usr/bin/perl use warnings; use strict; dbmopen my %users,'users',664; $users{mulander}->{email} = 'netprobe@gmail.com'; print "$users{mulander}->{email}\n"; dbmclose %users;
I wonder why does this work fine when used on a ordinardy hash and fails when I open the hash via dbmopen? What am I doing wrong? Is a dbmopen hash different than an ordinary hash? And if so should I use another method to tie this data structure to a file? ( maybe Tie::Scalar or something? ).Can't use string ("HASH(0x1865480)") as a HASH ref while "strict refs" + in use
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: dbmopen and hashes of hashes
by philcrow (Priest) on Oct 13, 2005 at 14:29 UTC | |
by jgallagher (Pilgrim) on Oct 13, 2005 at 14:36 UTC | |
by mulander (Monk) on Oct 13, 2005 at 14:48 UTC |