Skip Menu |
Report information
Id: 844
Status: resolved
Priority: 0/
Queue: perl5

Owner: Nobody
Requestors: mjd [at]

Operating System: Linux
PatchStatus: (no value)
Severity: medium
Type: library
Perl Version: 5.6.0
Fixed In: (no value)

To: perlbug [...]
Cc: mjd [...]
Subject: 5.005_57: Regex behaves incorrectly
Date: Thu, 03 Jun 1999 17:16:30 -0400
From: Mark-Jason Dominus <mjd [...]>
This should print `!!!' before it does anything else, and in this case the regex should match. (It's a slightly modified version of the regex from page 200 of _Perl Cookbook_; it should match any string that does not end in `foo'. However, it doesn't match, and it doesn't print `!!!' either. If I remove the $ from the end of the regex, it prints `!!!'. If I remove (?{print "$2 "}) from the middle, it prints `!!!'. If I change the target string from `xf' to `x', it prints `!!!'. Summary of my perl5 (revision 5.0 version 5 subversion 57) configuration: Platform: osname=linux, osvers=2.0.35, archname=i586-linux uname='linux plover 2.0.35 #2 mon oct 26 21:26:00 cst 1998 i586 unknown ' config_args='-Doptimize=-g -des' hint=recommended, useposix=true, d_sigaction=define usethreads=undef useperlio=undef d_sfio=undef use64bits=undef usemultiplicity=undef Compiler: cc='cc', optimize='-g', gccversion=egcs-2.90.29 980515 (egcs-1.0.3 release) cppflags='-Dbool=char -DHAS_BOOL -DDEBUGGING -I/usr/local/include' ccflags ='-Dbool=char -DHAS_BOOL -DDEBUGGING -I/usr/local/include' 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 alignbytes=4, usemymalloc=n, prototype=define Linker and Libraries: ld='cc', ldflags =' -L/usr/local/lib' libpth=/usr/local/lib /shlib /lib /usr/lib libs=-lndbm -lgdbm -ldbm -ldb -ldl -lm -lc 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' Characteristics of this binary (from libperl): Compile-time options: DEBUGGING Built under linux Compiled at May 25 1999 16:00:13 @INC: /usr/local/lib/perl5/5.00557/i586-linux /usr/local/lib/perl5/5.00557 /usr/local/lib/perl5/site_perl/5.00557/i586-linux /usr/local/lib/perl5/site_perl/5.00557 . Mark-Jason Dominus
Date: Mon, 20 Mar 2000 21:12:59 -0700 (MST)
From: Nathan Torkington <gnat [...]>
To: perl5-porters [...]
Cc: mjd [...], ilya [...]
Subject: [19990603.010] 5.005_57: Regex behaves incorrectly
Download (untitled) / with headers
text/plain 481b
Mark, The code you gave: #!/usr/bin/perl -w $z = ("xf" =~ m{^ (?{print "!!!\n"}) ( ( (?!foo$ ) . ) (?{print "$2 "}) * ) $ }x); print "$z\n"; now emits a warning (in 5.6-RC2): Show quoted text
> (?{print "$2 "}) > * > matches null string many times at /tmp/asdf line 13.
I don't know whether this helps your code or reflects a different bug :-) Nat
To: Nathan Torkington <gnat [...]>
Cc: perl5-porters [...], mjd [...], ilya [...]
Subject: Re: [19990603.010] 5.005_57: Regex behaves incorrectly
Date: Mon, 20 Mar 2000 23:19:25 -0500
From: Mark-Jason Dominus <mjd [...]>
Download (untitled) / with headers
text/plain 184b
Show quoted text
> Mark, > > The code you gave:
The warning makes sense, and I can't imagine what possessed me to put a * there. Can you send me some private email to remind me of the context?

This service is sponsored and maintained by Best Practical Solutions and runs on infrastructure.

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at