> -----Original Message-----
> From: Rowan Reid [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, September 10, 2002 2:18 PM
> To: 'Perl beginners'
> Subject: Storing complex Data structures ?
> 
> 
> 
> 
> What is the correct way to access and store complex data 
> structures to a
> file. I.e. hashes with several references.  The method I have 
> been using
> is as follows
> 
> tie 
> (%COMPANY_DB,'MLDBM','studio3.db',O_RDWR|O_CREAT,0777,$DB_BTREE) ||
> die $!;
> 
> Also DB_File.  
> I'm realizing from previous help that I have to access this 
> as an Object
> as in
> 
> $db = tie
> (%COMPANY_DB,'MLDBM','studio3.db',O_RDWR|O_CREAT,0777,$DB_BTRE
> E) || die
> $!;
> 
> Where in my %COMPANY_DB
>  %COMPANY_DB -@employee -n 
>                                       - %info 
>                                               name=>'name'
>                                               address =>@address
> And so forth what would be the correct way to access contents of the
> data structure using the object $db ?

No. You access the data through %COMPANY_DB. That's the whole point of
tie(). The object $db is used only if you need to call additional methods of
MLDBM on it. You really don't even need to save $db, because you can always
get it via:

   tied(%COMPANY_DB)

perldoc -f tie
perldoc -f tied
perldoc perltie

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to