problems with Memoize::Storable
- From: danielmcbrearty@xxxxxxxxx
- Date: 22 Feb 2007 13:54:10 -0800
hi,
short script to try to use this module:
#!/usr/bin/perl
use strict;
use warnings;
use Memoize qw( memoize unmemoize );
use Memoize::Storable;
tie my %cache => 'Memoize::Storable', 'cache_file';
memoize 'doit', SCALAR_CACHE => [HASH => \%cache];
print "before : \n";
doit();
print "after : \n";
sub doit {
for ( 1 .. 10 ){
unless (exists $cache{$_}){
print "adding $_\n";
$cache{$_} = "blah $_";
}
}
}
when I run it, I get:
daniel@daniel-ubuntu:~/tmp$ ./memoize_st.pl
before :
adding 1
adding 2
adding 3
adding 4
adding 5
adding 6
adding 7
adding 8
adding 9
adding 10
after :
Segmentation fault
I've checked, both Memoize and Memoize::Storable are up to date.
what could be the issue? any ideas?
thanks, Daniel
PS maybe this helps .. :
daniel@daniel-ubuntu:~/tmp$ perl -V
Summary of my perl5 (revision 5 version 8 subversion 8) configuration:
Platform:
osname=linux, osvers=2.6.15-27-386, archname=i686-linux-thread-
multi
uname='linux daniel-ubuntu 2.6.15-27-386 #1 preempt sat sep 16
01:51:59 utc 2006 i686 gnulinux '
config_args='-d -Dusethreads'
hint=recommended, useposix=true, d_sigaction=define
usethreads=define use5005threads=undef useithreads=define
usemultiplicity=define
useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
use64bitint=undef use64bitall=undef uselongdouble=undef
usemymalloc=n, bincompat5005=undef
Compiler:
cc='cc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -
fno-strict-aliasing -pipe -Wdeclaration-after-statement -I/usr/local/
include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
optimize='-O2',
cppflags='-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -fno-
strict-aliasing -pipe -Wdeclaration-after-statement -I/usr/local/
include'
ccversion='', gccversion='4.0.3 (Ubuntu 4.0.3-1ubuntu5)',
gccosandvers=''
intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
d_longlong=define, longlongsize=8, d_longdbl=define,
longdblsize=12
ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t',
lseeksize=8
alignbytes=4, prototype=define
Linker and Libraries:
ld='cc', ldflags =' -L/usr/local/lib'
libpth=/usr/local/lib /lib /usr/lib
libs=-lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lpthread -lc
perllibs=-lnsl -ldl -lm -lcrypt -lutil -lpthread -lc
libc=/lib/libc-2.3.6.so, so=so, useshrplib=false,
libperl=libperl.a
gnulibc_version='2.3.6'
Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E'
cccdlflags='-fpic', lddlflags='-shared -L/usr/local/lib'
Characteristics of this binary (from libperl):
Compile-time options: MULTIPLICITY PERL_IMPLICIT_CONTEXT
PERL_MALLOC_WRAP THREADS_HAVE_PIDS
USE_ITHREADS
USE_LARGE_FILES USE_PERLIO USE_REENTRANT_API
Built under linux
Compiled at Sep 19 2006 16:22:00
@INC:
/usr/local/lib/perl5/5.8.8/i686-linux-thread-multi
/usr/local/lib/perl5/5.8.8
/usr/local/lib/perl5/site_perl/5.8.8/i686-linux-thread-multi
/usr/local/lib/perl5/site_perl/5.8.8
/usr/local/lib/perl5/site_perl
.
.
- Follow-Ups:
- Re: problems with Memoize::Storable
- From: Mumia W.
- Re: problems with Memoize::Storable
- Prev by Date: Re: CPAN install issues
- Next by Date: Re: CPAN install issues
- Previous by thread: Newbie: Installing Modules
- Next by thread: Re: problems with Memoize::Storable
- Index(es):
Relevant Pages
|
|