I ran into a strange inconsistency in interaction between Storable and 
Class::MethodMaker between a development and production server that are both running 
builds of perl, mod_perl, and apache from the same source files.  On the development 
server, the following code executes without error, on the production server it gives a 
fatal error because the Class::MethodMaker list accessor sees itself being called in 
array context and returns an array rather than an array reference.  The scalar appears 
to be called in scalar context on the working system.  Has anyone else seen this type 
of anomaly?

I think the correct behavior is actually the failing case that I get on the production 
server.  If I run the code from the command line on the development machine (using the 
perl interpreter from the same build), I get a fatal error with the 'not a reference' 
method on the Storable::freeze line.

I am using Class::MethodMaker version 1.05 and Storable version 1.014 on both machines.

package PackageName;
 use Class::MethodMaker
 list => [ qw( panel_list ) ], ...,
;

#-----------------------------
sub _insert {
...
use Storable;
my $s = Storable::freeze( $self->panel_list );  # Fails on this line, saying 'not a 
reference'
}

The development box (on which the code works) has the following configuration:

Summary of my perl5 (revision 5.0 version 6 subversion 1) configuration:
  Platform:
    osname=linux, osvers=2.4.10-4gb, archname=i686-linux
    uname='linux garnet 2.4.10-4gb #1 fri sep 28 17:20:21 gmt 2001 i686 unknown '
    config_args=''
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef
    useperlio=undef d_sfio=undef uselargefiles=define usesocks=undef
    use64bitint=undef use64bitall=undef uselongdouble=undef
  Compiler:
    cc='cc', ccflags ='-fno-strict-aliasing -D_LARGEFILE_SOURCE 
-D_FILE_OFFSET_BITS=64',
    optimize='-O2',
    cppflags='-fno-strict-aliasing'
    ccversion='', gccversion='2.95.3 20010315 (SuSE)', 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, usemymalloc=n, prototype=define
  Linker and Libraries:
    ld='cc', ldflags =''
    libpth=/lib /usr/lib
    libs=-lnsl -lndbm -lgdbm -ldb -ldl -lm -lc -lcrypt -lutil
    perllibs=-lnsl -ldl -lm -lc -lcrypt -lutil
    libc=, so=so, useshrplib=false, libperl=libperl.a
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic'
    cccdlflags='-fpic', lddlflags='-shared'

The production server has the following configuration:
Summary of my perl5 (revision 5.0 version 6 subversion 1) configuration:
  Platform:
    osname=linux, osvers=2.4.0-64gb-smp, archname=i686-linux
    uname='linux eqr002 2.4.0-64gb-smp #1 smp wed jan 24 15:52:30 gmt 2001 i686 
unknown '
    config_args=''
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef
    useperlio=undef d_sfio=undef uselargefiles=define usesocks=undef
    use64bitint=undef use64bitall=undef uselongdouble=undef
  Compiler:
    cc='cc', ccflags ='-fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE 
-D_FILE_OFFSET_BITS=64',
    optimize='-O2',
    cppflags='-fno-strict-aliasing -I/usr/local/include'
    ccversion='', gccversion='2.95.2 19991024 (release)', 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, usemymalloc=n, prototype=define
  Linker and Libraries:
    ld='cc', ldflags =' -L/usr/local/lib'
    libpth=/usr/local/lib /lib /usr/lib
    libs=-lnsl -lndbm -lgdbm -ldb -ldl -lm -lc -lcrypt -lutil
    perllibs=-lnsl -ldl -lm -lc -lcrypt -lutil
    libc=, so=so, useshrplib=false, libperl=libperl.a
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic'
    cccdlflags='-fpic', lddlflags='-shared -L/usr/local/lib'




Matthew Pressly

Reply via email to