RE: Storing complex Data structures ?

2002-09-11 Thread NYIMI Jose (BMB)

You can also store your complexe data structures in a xml file by using XML::Simple 
module.

http://search.cpan.org/author/GRANTM/XML-Simple-1.08/Simple.pm


José.

-Original Message-
From: Rowan Reid [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, September 10, 2002 8:39 PM
To: 'Perl beginners'
Subject: RE: Storing complex Data structures ?



 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)

This is what I did previously, but whenever I closed the data file And tried to 
re-open it the data could nto be retrieved. I was under The impression that DB-File 
was able to store referenced data.

 
 perldoc -f tie
 perldoc -f tied
 perldoc perltie
 


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



 DISCLAIMER 

This e-mail and any attachment thereto may contain information which is confidential 
and/or protected by intellectual property rights and are intended for the sole use of 
the recipient(s) named above. 
Any use of the information contained herein (including, but not limited to, total or 
partial reproduction, communication or distribution in any form) by other persons than 
the designated recipient(s) is prohibited. 
If you have received this e-mail in error, please notify the sender either by 
telephone or by e-mail and delete the material from any computer.

Thank you for your cooperation.

For further information about Proximus mobile phone services please see our website at 
http://www.proximus.be or refer to any Proximus agent.


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




Storing complex Data structures ?

2002-09-10 Thread Rowan Reid



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_BTREE) || 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 ?

Thanks in advance.

 
Rowan Reid
Job Captain, 
Systems Administrator
STUDIO 3 ARCHITECTS
909  982  1717


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




Re: Storing complex Data structures ?

2002-09-10 Thread Paul Johnson

On Tue, Sep 10, 2002 at 11:17:33AM -0700, Rowan Reid wrote:

 What is the correct way to access and store complex data structures to a
 file. I.e. hashes with several references.

This is Perl.  There is no correct way.

But you could take a look at Data::Dumper and Storable for other
solutions.  You might also like to investigate YAML.

-- 
Paul Johnson - [EMAIL PROTECTED]
http://www.pjcj.net

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




RE: Storing complex Data structures ?

2002-09-10 Thread Bob Showalter

 -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]




RE: Storing complex Data structures ?

2002-09-10 Thread Rowan Reid


 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)

This is what I did previously, but whenever I closed the data file
And tried to re-open it the data could nto be retrieved. I was under
The impression that DB-File was able to store referenced data.

 
 perldoc -f tie
 perldoc -f tied
 perldoc perltie
 


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