develooper Front page | perl.perl5.porters | Postings from April 2000

[ID 20000405.017] qr/(.$)/m not the same as /(?m-xis:(.$))/ with /g

From:
Rick Delaney
Date:
April 5, 2000 08:55
Subject:
[ID 20000405.017] qr/(.$)/m not the same as /(?m-xis:(.$))/ with /g
Message ID:
200004051556.PAA11763@consumer.consumercontact.com

This is a bug report for perl from rick@consumercontact.com,
generated with the help of perlbug 1.28 running under perl v5.6.0.

I expect "with qr" should behave like "without qr" below.

#!/opt/perl/bin/perl -lw

$_ = <<C;
A
B
C

my $pat = '(.$)';
my $str = "(?m-xis:$pat)"; 
my $RE  = qr/$pat/m;

print "Matching /$str/ without qr";
print $1 while /$str/g;
print "Matching /$RE/ with qr";
print $1 while /$RE/g;

__END__
Matching /(?m-xis:(.$))/ without qr
A
B
Matching /(?m-xis:(.$))/ with qr
B

With -Dr:

EXECUTING...

Compiling REx `(.$)'
size 7 first at 3
rarest char 
 at 0
   1: OPEN1(3)
   3:   REG_ANY(4)
   4:   MEOL(5)
   5: CLOSE1(7)
   7: END(0)
anchored `'$ at 1 minlen 1 

Compiling REx `(?m-xis:(.$))'
size 7 first at 3
   1: OPEN1(3)
   3:   REG_ANY(4)
   4:   MEOL(5)
   5: CLOSE1(7)
   7: END(0)
minlen 1 

[rest trimmed]

---
Flags:
    category=core
    severity=low
---
Site configuration information for perl v5.6.0:

Configured by rick at Fri Mar 31 17:49:37 EST 2000.

Summary of my perl5 (revision 5.0 version 6 subversion 0) configuration:
  Platform:
    osname=svr4, osvers=, archname=i386-svr4
    uname='unix_sv consumer 4.2mp 2.1.3 i386 x86at '
    config_args='-Dprefix=/opt/perl -Doptimize=-g'
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef
    useperlio=undef d_sfio=undef uselargefiles=define 
    use64bitint=undef use64bitall=undef uselongdouble=undef usesocks=undef
  Compiler:
    cc='/bin/cc', optimize='-g', gccversion=
    cppflags='-I/usr/include -I/usr/ucbinclude -DDEBUGGING -I/usr/local/include'
    ccflags ='-I/usr/include -I/usr/ucbinclude -DDEBUGGING -I/usr/local/include'
    stdchar='unsigned char', d_stdstdio=define, usevfork=false
    intsize=4, longsize=4, ptrsize=4, doublesize=8
    d_longlong=undef, longlongsize=, d_longdbl=define, longdblsize=12
    ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=4
    alignbytes=4, usemymalloc=y, prototype=define
  Linker and Libraries:
    ld='/bin/cc', ldflags ='-L/usr/ccs/lib -L/usr/ucblib -L/usr/local/lib -L/usr/gnu/lib'
    libpth=/usr/local/lib /usr/gnu/lib /shlib /lib /usr/lib /usr/ccs/lib /usr/ucblib
    libs=-lsocket -lnsl -ldbm -ldb -ldl -lld -lm -lc -lcrypt -lucb
    libc=, so=so, useshrplib=true, libperl=libperl.so
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' '
    cccdlflags='-KPIC', lddlflags='-G -L/usr/ccs/lib -L/usr/ucblib -L/usr/local/lib -L/usr/gnu/lib'

Locally applied patches:
    

---
@INC for perl v5.6.0:
    /opt/perl/lib/5.6.0/i386-svr4
    /opt/perl/lib/5.6.0
    /opt/perl/lib/site_perl/5.6.0/i386-svr4
    /opt/perl/lib/site_perl/5.6.0
    /opt/perl/lib/site_perl
    .

---
Environment for perl v5.6.0:
    HOME=/home1/rick
    LANG=C
    LANGUAGE (unset)
    LD_LIBRARY_PATH=/data1/systems/dev/perl-5.6.0:/usr/opt/dash/lib:.:/lib:/usr/lib:/usr/lib/ARCserve
    LOGDIR (unset)
    PATH=/bin:/usr/bin:/opt/perl/bin
    PERL_BADLANG (unset)
    SHELL=/usr/bin/ksh



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