pelagic has asked for the wisdom of the Perl Monks concerning the following question:
Hell Monks,
this short example of mine tries to store the 'memory' of the Module memoize in a file but it segfaults.
pelagic
and says:use strict; use Memoize; use Memoize::Storable; my $filename = './memory.tmp'; tie my %cache => 'Memoize::Storable', $filename; memoize 'function', SCALAR_CACHE => [HASH => \%cache]; print function(1), "\n"; print function(1), "\n"; print function(1), "\n"; print function(2), "\n"; sub function { my $wtf = shift; print "I am the function\n"; return 'anything'; }
Any ideas?# perl memo I am the function anything anything anything I am the function anything Segmentation fault #
pelagic
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Memoize::Storable produces 'Segmentation fault'
by gmargo (Hermit) on Oct 19, 2009 at 15:32 UTC | |
by pelagic (Priest) on Oct 19, 2009 at 18:44 UTC | |
Re: Memoize::Storable produces 'Segmentation fault'
by Anonymous Monk on Oct 19, 2009 at 15:12 UTC |
Back to
Seekers of Perl Wisdom