Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Saving and restoring hash variable data

by as_ndr (Initiate)
on Dec 09, 2005 at 16:42 UTC ( [id://515589]=note: print w/replies, xml ) Need Help??


in reply to Saving and restoring hash variable data

Solution I am using:
use XML::Dumper; my $dump = new XML::Dumper; $db{worda}[0] = "stringa"; $db{worda}[1] = "stringb"; $db{worda}[2] = "stringc"; $db{wordb}[0] = "stringd"; $db{wordb}[1] = "stringe"; $db{wordc}[0] = "stringf"; $db{wordd}[0] = "stringg"; $db{worde}[1] = "stringh"; $db{worde}[2] = "stringi"; $db{worde}[3] = "stringj"; my $file = "dump.xml"; $dump->pl2xml( \%db, $file ); my %perl = $dump->xml2pl( $file ); print "New ref: $perl{worde}[3]\n";

I can't get the end part to work, though. Once the data is back into %perl, how to I access it correctly?

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://515589]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (5)
As of 2024-04-20 02:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found