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

[perl #41916] match a single byte \C doesn't work in character class

Thread Next
From:
Christopher Lane
Date:
March 19, 2007 16:41
Subject:
[perl #41916] match a single byte \C doesn't work in character class
Message ID:
rt-3.6.HEAD-1687-1174345046-1019.41916-75-0@perl.org
# New Ticket Created by  Christopher Lane 
# Please include the string:  [perl #41916]
# in the subject line of all future correspondence about this issue. 
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=41916 >


This is a bug report for perl from cdl@best.com,
generated with the help of perlbug 1.35 running under perl v5.8.6.

The following prints "yes" (ie. works)

perl -we 'print(("a" =~ m/\C/) ? "yes" : "no", "\n")'

But this (added [] around \C) prints a warning and doesn't work  
(prints "no")

perl -we 'print(("a" =~ m/[\C]/) ? "yes" : "no", "\n")'
Unrecognized escape \C in character class passed through in regex;
marked by <-- HERE in m/[\C <-- HERE ]/ at -e line 1.

I tested this with and without 'use charnames'
This also appears to be the case with \X
This also appears to be the case under Perl 5.8.8

I've no personal need for this to be fixed, I'm simply trying to  
characterize in a technical note which character class abbreviations  
work inside m/[]/ and which do not.  These two seem inconsistent with  
the rest.  So, a simple confirmation that this is a bug or a  
misunderstanding on my part is sufficient.  Thank you!
---
Flags:
     category=core
     severity=low
---
Site configuration information for perl v5.8.6:

Configured by root at Thu Nov  2 10:35:22 PST 2006.

Summary of my perl5 (revision 5 version 8 subversion 6) configuration:
   Platform:
     osname=darwin, osvers=8.0, archname=darwin-thread-multi-2level
     uname='darwin b07.apple.com 8.0 darwin kernel version 8.3.0: mon  
oct 3 20:04:04 pdt 2005; root:xnu-792.6.22.obj~2release_ppc power  
macintosh powerpc '
     config_args='-ds -e -Dprefix=/usr -Dccflags=-g  -pipe  - 
Dldflags=-Dman3ext=3pm -Duseithreads -Duseshrplib'
     hint=recommended, useposix=true, d_sigaction=define
     usethreads=define use5005threads=undef 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 ='-g -pipe -fno-common -DPERL_DARWIN -no-cpp- 
precomp -fno-strict-aliasing -I/usr/local/include',
     optimize='-Os',
     cppflags='-no-cpp-precomp -g -pipe -fno-common -DPERL_DARWIN -no- 
cpp-precomp -fno-strict-aliasing -I/usr/local/include'
     ccversion='', gccversion='3.3 20030304 (Apple Computer, Inc.  
build 1819)', gccosandvers=''
     intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=4321
     d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=8
     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 ='-L/usr/ 
local/lib'
     libpth=/usr/local/lib /usr/lib
     libs=-ldbm -ldl -lm -lc
     perllibs=-ldl -lm -lc
     libc=/usr/lib/libc.dylib, so=dylib, useshrplib=true,  
libperl=libperl.dylib
     gnulibc_version=''
   Dynamic Linking:
     dlsrc=dl_dlopen.xs, dlext=bundle, d_dlsymun=undef, ccdlflags=' '
     cccdlflags=' ', lddlflags='-bundle -undefined dynamic_lookup -L/ 
usr/local/lib'

Locally applied patches:
     23953 - fix for File::Path::rmtree CAN-2004-0452 security issue
     33990 - fix for setuid perl security issues
     SPRINTF0 - fixes for sprintf formatting issues - CVE-2005-3962

---
@INC for perl v5.8.6:
     /sw/lib/perl5/5.8.6/darwin-thread-multi-2level
     /sw/lib/perl5/5.8.6
     /sw/lib/perl5
     /sw/lib/perl5/darwin
     /System/Library/Perl/5.8.6/darwin-thread-multi-2level
     /System/Library/Perl/5.8.6
     /Library/Perl/5.8.6/darwin-thread-multi-2level
     /Library/Perl/5.8.6
     /Library/Perl
     /Network/Library/Perl/5.8.6/darwin-thread-multi-2level
     /Network/Library/Perl/5.8.6
     /Network/Library/Perl
     /System/Library/Perl/Extras/5.8.6/darwin-thread-multi-2level
     /System/Library/Perl/Extras/5.8.6
     /Library/Perl/5.8.1
     .

---
Environment for perl v5.8.6:
     DYLD_LIBRARY_PATH (unset)
     HOME=/Volumes/Users HD/cdl
     LANG (unset)
     LANGUAGE (unset)
     LD_LIBRARY_PATH (unset)
     LOGDIR (unset)
     PATH=/sw/bin:/sw/sbin:.:/Users/cdl/bin:/usr/bin:/bin:/usr/local/ 
bin:/sbin:/usr/sbin:/etc:/opt/local/bin:/opt/local/sbin:/usr/X11R6/bin
     PERL5LIB=/sw/lib/perl5:/sw/lib/perl5/darwin
     PERL_BADLANG (unset)
     SHELL=/bin/csh


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