Front page | perl.perl5.porters |
Postings from November 1999
[ID 19991130.003] Assignment to List Breaks \G.
Thread Next
From:
Ralph Corderoy
Date:
November 30, 1999 08:07
Subject:
[ID 19991130.003] Assignment to List Breaks \G.
Message ID:
199911301610.QAA13007@inputplus.demon.co.uk
Hi,
Assigning a /gx regexp to a list breaks \G in the following regexp.
#! /usr/local/bin/perl -w
$_ = 'a 1 b 2 c 3';
print "bug\n";
($a, $b) = /^(\w)\s(\d)\s/gx;
print "a=$a b=$b\n";
($a, $b) = /\G(\w)\s(\d)/gx;
print "a=$a b=$b\n";
print "workaround\n";
/^(\w)\s(\d)\s/gx;
($a, $b) = ($1, $2);
print "a=$a b=$b\n";
($a, $b) = /\G(\w)\s(\d)/gx;
print "a=$a b=$b\n";
Output is
bug
a=a b=1
a=a b=1
workaround
a=a b=1
a=b b=2
Here's the configuration of my perl at home, but the one at work,
5.00502, also exihibits this.
Ralph.
Site configuration information for perl 5.00404:
Configured by root at Thu Sep 10 02:15:30 EDT 1998.
Summary of my perl5 (5.0 patchlevel 4 subversion 4) configuration:
Platform:
osname=linux, osvers=2.0.34, archname=i386-linux
uname='linux porky.redhat.com 2.0.34 #1 thu may 7 10:17:44 edt 1998 i686 unknown '
hint=recommended, useposix=true, d_sigaction=define
bincompat3=y useperlio=undef d_sfio=undef
Compiler:
cc='cc', optimize='-O2', gccversion=2.7.2.3
cppflags='-Dbool=char -DHAS_BOOL -I/usr/local/include'
ccflags ='-Dbool=char -DHAS_BOOL -I/usr/local/include'
stdchar='char', d_stdstdio=define, usevfork=false
intsize=4, longsize=4, ptrsize=undef, doublesize=undef
alignbytes=4, usemymalloc=n, prototype=define
Linker and Libraries:
ld='cc', ldflags =' -L/usr/local/lib'
libpth=/usr/local/lib /lib /usr/lib
libs=-lnsl -lndbm -lgdbm -ldb -ldl -lm -lc -lposix -lcrypt
libc=, 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'
Thread Next
-
[ID 19991130.003] Assignment to List Breaks \G.
by Ralph Corderoy