Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: How to save and reload my hash

by GrandFather (Saint)
on Nov 20, 2005 at 08:05 UTC ( [id://510214]=note: print w/replies, xml ) Need Help??


in reply to How to save and reload my hash

Take a look at XML::Simple. It does exactly what you want:

use XML::Simple; my $options = XMLin ('teams.badDB') if -e 'teams.badDB'; # do stuff with $options $options->{'time'} = 15 * 60 if ! exists $options->{'time'}; $options->{'width'} = 200 if ! exists $options->{'width'}; # ... open outFile, '>', 'teams.badDB'; print outFile XMLout ($options); close outFile;

DWIM is Perl's answer to Gödel

Replies are listed 'Best First'.
Re^2: How to save and reload my hash
by Anonymous Monk on Dec 05, 2014 at 10:50 UTC
    And to greatly speed up XMLin if you have large XML files, you can call it with the parameter Cache=>storable, or other available caching options.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (3)
As of 2024-04-25 19:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found