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

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

Thread Next
From:
Father Chrysostomos
Date:
March 24, 2013 21:01
Subject:
[perl #117327] Sequence (?#...) not recognized in regex
Message ID:
rt-3.6.HEAD-28177-1364158892-835.117327-75-0@perl.org
# New Ticket Created by  Father Chrysostomos 
# Please include the string:  [perl #117327]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org:443/rt3/Ticket/Display.html?id=117327 >


$ perl5.16.0 -le 'print "ab" =~ /a( ?#foo)b/x'
1
$ ./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 <nick@ccl4.org>
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
    http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2003-03/msg00840.html
    
    The patch wasn't applied at that time, and when he sent it again August,
    he omitted that hunk. See
    http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2003-08/msg01820.html
    
    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.

---
Flags:
    category=core
    severity=low
---
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
  Platform:
    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
  Compiler:
    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
    gnulibc_version=''
  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:
    lib
    /usr/local/lib/perl5/site_perl/5.17.11/darwin-thread-multi-2level
    /usr/local/lib/perl5/site_perl/5.17.11
    /usr/local/lib/perl5/5.17.11/darwin-thread-multi-2level
    /usr/local/lib/perl5/5.17.11
    /usr/local/lib/perl5/site_perl
    .

---
Environment for perl 5.17.11:
    DYLD_LIBRARY_PATH (unset)
    HOME=/Users/sprout
    LANG=en_US.UTF-8
    LANGUAGE (unset)
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/usr/local/bin
    PERL_BADLANG (unset)
    SHELL=/bin/bash

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About