in reply to User preference: To store params or not

I think i would have the defaults in a temporary hash and merge that with the users preferences:

my %default = ( foo => 1, bar => 2); my %users = ( bar =>3 , baz => 2 ); my %CONFIG = ( %default, %users ); # user overrides default

This way you shouldn't have to reset them, they get applied "on the fly."

jeffa

L-LL-L--L-LL-L--L-LL-L--
-R--R-RR-R--R-RR-R--R-RR
B--B--B--B--B--B--B--B--
H---H---H---H---H---H---
(the triplet paradiddle with high-hat)

Replies are listed 'Best First'.
Re^2: User preference: To store params or not
by stevieb (Canon) on Jul 28, 2015 at 23:09 UTC

    Thanks jeffa. I'm trying to implement a cache for data, and it requires past params to be known. I'm seriously considering writing a is_deeply type filter for Memoize to do this work so I don't have to.