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