Come for the quick hacks, stay for the epiphanies. | |
PerlMonks |
Memoize::Expire oddityby Random_Walk (Prior) |
on Aug 14, 2013 at 14:18 UTC ( [id://1049426]=perlquestion: print w/replies, xml ) | Need Help?? |
Random_Walk has asked for the wisdom of the Perl Monks concerning the following question: I was just playing around with Memoize::Expire and did a one line test. It worked as expected when I use "print f().$/" but does not expire the memoized function f() when I use "say f();"
After a bit of tracking down I found it only works when the function is called in scalar context. For instance say f()+0; works fine. I tried altering my invocation of memoize to use LIST_CACHE rather than SCALAR_CACHE but then it crashes Can't use string ("ARRAY(0x9c7494)") as an ARRAY ref while "strict refs" in use at C:/Perl516/lib/Memoize.pm line 258.Does anyone know if Memoize::Expire can be got to work in list context? Or do I have to roll my own if I need that Cheers,
Pereant, qui ante nos nostra dixerunt!
Back to
Seekers of Perl Wisdom
|
|