http://www.perlmonks.org?node_id=72942

entropy has asked for the wisdom of the Perl Monks concerning the following question: (data structures)

How do I save a nested structure to a file (and read it later)?

Originally posted as a Categorized Question.

Replies are listed 'Best First'.
Re: How do I save a nested structure to a file (and read it later)?
by merlyn (Sage) on Apr 17, 2001 at 00:54 UTC
Re: How do I save a nested structure to a file (and read it later)?
by ton (Friar) on Apr 17, 2001 at 01:45 UTC
    You can also use Data::Dumper, which is not as efficient but is human readable.
Re: How do I save a nested structure to a file (and read it later)?
by Malkavian (Friar) on Apr 17, 2001 at 14:53 UTC
    I've got a personal favourite of FreezeThaw which is pretty friendly, and does the job nicely.
      FreezeThaw will definitely do the job, you might also want to look into Data::Dumper - especially if you want to manually edit the data while it's in the file.
      print FILE Dumper(%foo); $bar = <FILE>; %foo = eval{$bar};