develooper Front page | perl.perl5.porters | Postings from August 2001

[ID 20010821.006] embedded precompiled regex with /x ignores spaces

Thread Next
From:
sweth
Date:
August 21, 2001 18:13
Subject:
[ID 20010821.006] embedded precompiled regex with /x ignores spaces
Message ID:
20010822011211.9FB9B20C5@astaroth.sweth.net
This is a bug report for perl from sweth+perl@gwu.edu,
generated with the help of perlbug 1.26 running under perl 5.00503.


-----------------------------------------------------------------
[Please enter your report here]

	If a regex is precompiled with /x, and that regex is used
in a larger regex that does not have /x enabled, the larger regex still
ignores whitespace in it.  For example:

$ perl -MData::Dumper -e '$one = qr/(\d{1,2})/x; $two = qr/\S+/; @ary = ("12 4" =~ m/^$one ($two)/); print Dumper (@ary); @ary = ("12 4" =~ m/^$one\s($two)/); print Dumper (@ary);'
$VAR1 = 1;
$VAR2 = 2;
$VAR1 = 12;
$VAR2 = 4;

	; there should be no difference between the first match,
which uses a space, and the second, which uses "\s", but there is.
This has been confirmed on perl 5.00503 running on sun4-solaris,
ppc-linux, and i368-linx; the above works correctly on perl 5.6.0 on
sun4-solaris.

[Please do not change anything below this line]
-----------------------------------------------------------------

---
Site configuration information for perl 5.00503:

Configured by sweth at Sat Nov  6 15:27:39 EST 1999.

Summary of my perl5 (5.0 patchlevel 5 subversion 3) configuration:
  Platform:
    osname=solaris, osvers=2.7, archname=sun4-solaris
    uname='sunos cj952583-b 5.7 generic sun4u sparc sunw,ultra-2 '
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=undef useperlio=undef d_sfio=undef
  Compiler:
    cc='gcc -B/usr/ccs/bin/', optimize='-O', gccversion=2.95 19990728 (release)
    cppflags='-I/usr/local/include'
    ccflags ='-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=16
    alignbytes=8, usemymalloc=y, prototype=define
  Linker and Libraries:
    ld='gcc -B/usr/ccs/bin/', ldflags =' -L/usr/local/lib'
    libpth=/usr/local/lib /lib /usr/lib /usr/ccs/lib
    libs=-lsocket -lnsl -ldl -lm -lc -lcrypt
    libc=/lib/libc.so, so=so, useshrplib=false, libperl=libperl.a
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' '
    cccdlflags='-fPIC', lddlflags='-G -L/usr/local/lib'

Locally applied patches:
    

---
@INC for perl 5.00503:
    /home/sweth/lib/perl/site_perl
    /home/sweth/working/perl/lib
    /opt/perl/lib/5.00503/sun4-solaris
    /opt/perl/lib/5.00503
    /opt/perl/lib/site_perl/5.005/sun4-solaris
    /opt/perl/lib/site_perl/5.005
    .

---
Environment for perl 5.00503:
    HOME=/home/sweth
    LANG (unset)
    LANGUAGE (unset)
    LC_CTYPE=en_US
    LD_LIBRARY_PATH=/usr/lib:/usr/ucblib/:/usr/X/lib:/usr/openwin/lib:/usr/dt/lib:/usr/local/lib:/usr/local/lib/ncurses
    LOGDIR (unset)
    PATH=/home/sweth/bin:/usr/local/sbin:/usr/local/bin:/usr/xpg4/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/ccs/bin:/usr/proc/bin:/usr/dt/bin:/usr/openwin/bin:/usr/lib/lp/postscript:/usr/platform/sun4u/sbin:/usr/ucb:/opt/staroffice/bin:/home/sweth/working:.
    PERL5LIB=/home/sweth/lib/perl/site_perl:/home/sweth/working/perl/lib
    PERL_BADLANG (unset)
    SHELL=/usr/local/bin/zsh


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