develooper Front page | perl.perl5.porters | Postings from March 2013

[perl #117327] Sequence (?#...) not recognized in regex

Thread Next
Father Chrysostomos
March 24, 2013 21:01
[perl #117327] Sequence (?#...) not recognized in regex
Message ID:
# New Ticket Created by  Father Chrysostomos 
# Please include the string:  [perl #117327]
# in the subject line of all future correspondence about this issue. 
# <URL: >

$ perl5.16.0 -le 'print "ab" =~ /a( ?#foo)b/x'
$ ./perl -le 'print "ab" =~ /a( ?#foo)b/x'
Sequence (?#...) not recognized in regex; marked by <-- HERE in m/a( ?# <-- HERE foo)b/ at -e line 1.

This is the commit that changed it:

commit 504858073fe16afb61d66a8b6748851780e51432
Author: Nicholas Clark <>
Date:   Mon Jan 14 09:46:48 2013 +0100

    Remove unreachable duplicate (?#...) parsing code from S_reg()
    I believe that this code was rendered unreachable when perl 5.001 added
    code to S_nextchar() to skip over embedded comments. Adrian Enache noted
    this in March 2003, and proposed a patch which removed it. See
    The patch wasn't applied at that time, and when he sent it again August,
    he omitted that hunk. See
    That version was applied as commit e994fd663a4d8acc.

I suggest reverting it (for consistency with other (?...) constructs) and adding a test.  The attached patch does just that.

Site configuration information for perl 5.17.11:

Configured by sprout at Sat Mar 23 21:43:15 PDT 2013.

Summary of my perl5 (revision 5 version 17 subversion 11) configuration:
  Derived from: 9a51ab7a8994fa31039eb269e6c25ef95aa60af3
  Ancestor: 09af213235c12e35b077ae9eba7defc432f71e99
    osname=darwin, osvers=10.5.0, archname=darwin-thread-multi-2level
    uname='darwin pint.local 10.5.0 darwin kernel version 10.5.0: fri nov 5 23:20:39 pdt 2010; root:xnu-1504.9.17~1release_i386 i386 '
    config_args='-de -DDEBUGGING -Duseithreads -Dusedevel'
    hint=recommended, useposix=true, d_sigaction=define
    useithreads=define, usemultiplicity=define
    useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
    use64bitint=undef, use64bitall=undef, uselongdouble=undef
    usemymalloc=n, bincompat5005=undef
    cc='cc', ccflags ='-fno-common -DPERL_DARWIN -DDEBUGGING -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include',
    optimize='-O3 -g',
    cppflags='-fno-common -DPERL_DARWIN -DDEBUGGING -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include'
    ccversion='', gccversion='4.2.1 (Apple Inc. build 5664)', gccosandvers=''
    intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
    ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
    alignbytes=8, prototype=define
  Linker and Libraries:
    ld='env MACOSX_DEPLOYMENT_TARGET=10.3 cc', ldflags =' -fstack-protector -L/usr/local/lib'
    libpth=/usr/local/lib /usr/lib
    libs=-ldbm -ldl -lm -lutil -lc
    perllibs=-ldl -lm -lutil -lc
    libc=, so=dylib, useshrplib=false, libperl=libperl.a
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=bundle, d_dlsymun=undef, ccdlflags=' '
    cccdlflags=' ', lddlflags=' -bundle -undefined dynamic_lookup -L/usr/local/lib -fstack-protector'

Locally applied patches:

@INC for perl 5.17.11:

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