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.