[Nh-pm] Hash Persistence?

Morbus Iff morbus at disobey.com
Thu Apr 17 12:42:40 CDT 2003


 >I have a module which creates a rather large hash table.  The values
 >of this hash are also hashes.  I'm looking for a way to create
 >a persistent store for this Hash of hashes, any ideas?

  use Data::Dumper;
  print FILE Dumper(%evilhash);

and then to suck it in:

  if (-e $file) { do $file; }

"do" is relatively dangerous in that it sucks in $file and immediately 
executes the code into your application - you can tweak Dumper's output as 
well (naming the hash as you want it, etc.).

See:

  http://www.perldoc.com/perl5.8.0/pod/func/do.html
  http://www.perldoc.com/perl5.8.0/lib/Data/Dumper.html


-- 
Morbus Iff ( i'm the droid you're looking for )
Culture: http://www.disobey.com/ and http://www.gamegrene.com/
Buy My Book! http://amazon.com/exec/obidos/ASIN/0596004605/disobeycom
icq: 2927491 / aim: akaMorbus / yahoo: morbus_iff / jabber.org: morbus





More information about the Nh-pm mailing list