develooper Front page | perl.perl5.porters | Postings from February 2006

[perl #38605] Storable 2.15 freeze/thaw silently corrupts qr// regexps on 5.8.8

Thread Next
perlbug @ nissenhut . com
February 21, 2006 09:46
[perl #38605] Storable 2.15 freeze/thaw silently corrupts qr// regexps on 5.8.8
Message ID:
# New Ticket Created by 
# Please include the string:  [perl #38605]
# in the subject line of all future correspondence about this issue. 
# <URL: >

This is a bug report for perl from
generated with the help of perlbug 1.35 running under perl v5.8.8.

[Please enter your report here]

The Storable module silently corrupts regexps created with qr// during
freeze/thaw. The following code fragment shows the problem.

  use Storable qw(freeze thaw);
  use Data::Dumper;

  my $a = qr(this is a regexp);
  print Dumper($a);

  my $b = freeze($a);
  my $c = thaw($b);
  print Dumper($c);

Running it produces the following output:

  $VAR1 = qr/(?-xism:this is a regexp)/;
  $VAR1 = qr/Regexp=SCALAR(0x81f7b98)/;

The original and frozen/thawed regexps are not the same and do not
match the same strings.

While Regexp::Storable from CPAN provides a workaround, you typically
have to fall over the problem in Storable first before knowing you
need to get Regexp::Storable installed.

Can the functionality of Regexp::Storable be integrated into the core
Storable module?


david dot w dot james at nissenhut dot com

[Please do not change anything below this line]
Site configuration information for perl v5.8.8:

Configured by jamesdav at Tue Feb 21 14:22:15 GMT 2006.

Summary of my perl5 (revision 5 version 8 subversion 8) configuration:
    osname=linux, osvers=2.4.21-32.0.1.el.msdwhugemem, archname=i686-linux
    uname='linux oyifd91 2.4.21-32.0.1.el.msdwhugemem #1 smp mon dec 5 21:32:44 est 2005 i686 i686 i386 gnulinux '
    config_args='-ds -e -Dprefix=/var/tmp/jamesdav/perl5'
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef
    useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
    use64bitint=undef use64bitall=undef uselongdouble=undef
    usemymalloc=n, bincompat5005=undef
    cc='cc', ccflags ='-fno-strict-aliasing -pipe -Wdeclaration-after-statement -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm',
    cppflags='-fno-strict-aliasing -pipe -Wdeclaration-after-statement -I/usr/local/include -I/usr/include/gdbm'
    ccversion='', gccversion='3.2.3 20030502 (Red Hat Linux 3.2.3-42)', 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 -lc
    perllibs=-lnsl -ldl -lm -lcrypt -lutil -lc
    libc=/lib/, so=so, useshrplib=false, libperl=libperl.a
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E'
    cccdlflags='-fpic', lddlflags='-shared -L/usr/local/lib'

Locally applied patches:

@INC for perl v5.8.8:

Environment for perl v5.8.8:
    LANGUAGE (unset)
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PERL_BADLANG (unset)

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About