Subject: | Don't initialize $Memoize:Expire::DEBUG |
If Memoize::Expire is loaded after $Memoize:Expire::DEBUG was set to a true value, then this variable's value is again false. Demonstration:
perl -MMemoize -E '$Memoize::Expire::DEBUG = 1; require Memoize::Expire; tie my %c, "Memoize::Expire"; memoize "test", SCALAR_CACHE => [HASH => \%c]; sub test { rand() } say scalar test() for 1..2;'
-> No debugging output happens here.
Best is to NOT initialize $DEBUG, like in Memoize.pm.