develooper Front page | perl.perl5.porters | Postings from August 2001

[ID 20010815.012] Unfortunate interaction between -0 cmd line arg& (??{CODE}) regex

Thread Next
Eric Promislow
August 15, 2001 20:45
[ID 20010815.012] Unfortunate interaction between -0 cmd line arg& (??{CODE}) regex
Message ID:
This is a bug report for perl from,
generated with the help of perlbug 1.26 running under perl 5.006.

[Please enter your report here]

I encountered this bug when trying to debug a program with the -0
option (which was set by accident).  It turns out that the 
following code will only compile with either -012 set (on both
Linux and Windows, Windows using Active Perl binary build 628),
or -0 not given.  Changing $/ to anything other than "\n" in
a BEGIN block before the sub will also trigger the compile-time

Command-line:  no args needed

#!/usr/bin/perl -0

BEGIN { print "before sub\n" }

sub unbalanced {
    $balanced_brace_re ||= /(??{ $balanced_brace_re })/;
    return 'ab{cd{' !~ m/$balanced_brace_re/;

BEGIN { print "after sub\n" }  # not reached

[Please do not change anything below this line]

This perlbug was built using Perl 5.00503 - Thu Aug 10 15:31:56 EDT 2000
It is being executed now by  Perl 5.006 - Wed Aug 30 16:29:46 PDT 2000.

Site configuration information for perl 5.006:

Configured by build at Wed Aug 30 16:29:46 PDT 2000.

Summary of my perl5 (revision 5.0 version 6 subversion 0) configuration:
    osname=linux, osvers=2.2.15, archname=i686-linux-thread-multi
    uname='linux 2.2.15 #1 smp thu may 25 03:22:16 pdt 2000 i686 unknown '
    config_args='-des -Dcc=gcc -Uinstallusrbinperl -Dusethreads -Duseithreads -Dprefix=/usr/local/ActivePerl-5.6'
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=define use5005threads=undef useithreads=define usemultiplicity=define
    useperlio=undef d_sfio=undef uselargefiles=define 
    use64bitint=undef use64bitall=undef uselongdouble=undef usesocks=undef
    cc='gcc', optimize='-O2', gccversion=egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)
    cppflags='-D_REENTRANT -fno-strict-aliasing'
    ccflags ='-D_REENTRANT -fno-strict-aliasing -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64'
    stdchar='char', d_stdstdio=define, usevfork=false
    intsize=4, longsize=4, ptrsize=4, doublesize=8
    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='gcc', ldflags =' -L/usr/local/lib'
    libpth=/usr/local/lib /lib /usr/lib
    libs=-lnsl -ldl -lm -lpthread -lc -lposix -lcrypt
    libc=/lib/, 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'

Locally applied patches:

@INC for perl 5.006:

Environment for perl 5.006:
    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