Front page | perl.perl5.porters |
Postings from November 2008
[perl #60726] Should invalid regex brace syntax be interpreted literally with no warning?
Thread Next
From:
perlbug-followup
Date:
November 21, 2008 06:21
Subject:
[perl #60726] Should invalid regex brace syntax be interpreted literally with no warning?
Message ID:
rt-3.6.HEAD-16628-1227269617-1034.60726-75-0@perl.org
# New Ticket Created by james@netcraft.com
# Please include the string: [perl #60726]
# in the subject line of all future correspondence about this issue.
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=60726 >
This is a bug report for perl from james@netcraft.com,
generated with the help of perlbug 1.35 running under perl v5.8.7.
-----------------------------------------------------------------
Incorrect brace notation causes the brace to be interpreted as a
literal string instead, with no warning generated.
For example:
Perl -e 'use strict; use warnings; if ("111" =~ /\d{1.3}/) { print "true"; }'
perl -e 'use strict; use warnings; if ("1{1.3}" =~ /\d{1.3}/) { print "true"; }'
true
Whilst I understand why the second line returns true, that interpretation of the
braces was probably a mistake and so I think that if the warnings pragma is in
use, this should generate a warning.
Please accept my apologies if this is a desired feature, or if I have submitted
to the wrong section.
Thank you,
James Lawrie.
[Please do not change anything below this line]
-----------------------------------------------------------------
---
Flags:
category=core
severity=low
---
Site configuration information for perl v5.8.7:
Configured by cph at Thu Jan 26 09:23:34 GMT 2006.
Summary of my perl5 (revision 5 version 8 subversion 7) configuration:
Platform:
osname=freebsd, osvers=5.4-stable, archname=amd64-freebsd
uname='freebsd krups.netcraft.com 5.4-stable freebsd 5.4-stable #0: thu jan 19 13:09:42 gmt 2006 cph@krups.netcraft.com:vartmpscratchobjvartmpscratchsrcsyskrups amd64 '
config_args='-sde -Dprefix=/usr/local -Darchlib=/usr/local/lib/perl5/5.8.7/mach -Dprivlib=/usr/local/lib/perl5/5.8.7 -Dman3dir=/usr/local/lib/perl5/5.8.7/perl/man/man3 -Dman1dir=/usr/local/man/man1 -Dsitearch=/usr/local/lib/perl5/site_perl/5.8.7/mach -Dsitelib=/usr/local/lib/perl5/site_perl/5.8.7 -Dscriptdir=/usr/local/bin -Dsiteman3dir=/usr/local/lib/perl5/5.8.7/man/man3 -Dsiteman1dir=/usr/local/man/man1 -Ui_malloc -Ui_iconv -Uinstallusrbinperl -Dcc=cc -Duseshrplib -Dccflags=-DAPPLLIB_EXP="/usr/local/lib/perl5/5.8.7/BSDPAN" -Doptimize=-O -pipe -Ud_dosuid -Di_gdbm -Dusethreads=n -Dusemymalloc=y -Duse64bitint'
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=define use64bitall=define uselongdouble=undef
usemymalloc=y, bincompat5005=undef
Compiler:
cc='cc', ccflags ='-DAPPLLIB_EXP="/usr/local/lib/perl5/5.8.7/BSDPAN" -DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H -fno-strict-aliasing -pipe -I/usr/local/include',
optimize='-O -pipe ',
cppflags='-DAPPLLIB_EXP="/usr/local/lib/perl5/5.8.7/BSDPAN" -DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H -fno-strict-aliasing -pipe -I/usr/local/include'
ccversion='', gccversion='3.4.2 [FreeBSD] 20040728', gccosandvers=''
intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
alignbytes=8, prototype=define
Linker and Libraries:
ld='cc', ldflags ='-pthread -Wl,-E -L/usr/local/lib'
libpth=/usr/lib /usr/local/lib
libs=-lgdbm -lm -lcrypt -lutil
perllibs=-lm -lcrypt -lutil
libc=, so=so, useshrplib=true, libperl=libperl.so
gnulibc_version=''
Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' -Wl,-R/usr/local/lib/perl5/5.8.7/mach/CORE'
cccdlflags='-DPIC -fPIC', lddlflags='-shared -L/usr/local/lib'
Locally applied patches:
defined-or
SPRINTF0 - fixes for sprintf formatting issues - CVE-2005-3962
---
@INC for perl v5.8.7:
/usr/local/lib/perl5/site_perl/5.8.7
/usr/local/lib/perl5/5.8.7/BSDPAN
/usr/local/lib/perl5/site_perl/5.8.7/mach
/usr/local/lib/perl5/site_perl
/usr/local/lib/perl5/5.8.7/mach
/usr/local/lib/perl5/5.8.7
.
---
Environment for perl v5.8.7:
HOME=/home/james/
LANG (unset)
LANGUAGE (unset)
LD_LIBRARY_PATH (unset)
LOGDIR (unset)
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/games:/usr/local/sbin:/usr/local/bin:/usr/X11R6/bin:/home/james//bin
PERL_BADLANG (unset)
SHELL=/usr/local/bin/bash
Thread Next
-
[perl #60726] Should invalid regex brace syntax be interpreted literally with no warning?
by perlbug-followup