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

Re: [ID 20000330.005] defined ${$n} broken in 5.6 when $n is a number

Thread Previous | Thread Next
From:
Graham Barr
Date:
March 30, 2000 02:13
Subject:
Re: [ID 20000330.005] defined ${$n} broken in 5.6 when $n is a number
Message ID:
20000330111151.J18975@pobox.com
Some more info on this, If you add the line

  print $1,$2,$3;

to the start of the script, it suddenly works. It would seem that
explicitly typing $1 etc adds the gv to the stash at compile time which
allows a later ${$paren} to succeed. But without them the gv does not
exist in the stash and gv_fetchpv will return undef, reguardless of if
it is a special var.

The strange thing is I cannot see any real difference in this
part of the code between 5.005_03 and 5.6

Graham.

On Thu, Mar 30, 2000 at 10:28:26AM +0100, Graham Barr wrote:
> 
> This is a bug report for perl from gbarr@chipper.localdomain,
> generated with the help of perlbug 1.28 running under perl v5.6.0.
> 
> 
> -----------------------------------------------------------------
> [Please enter your report here]
> 
> The following snippet shows the problem, with 5.005_03 it outputs
> 
>  a 3
>  b 2
>  c 1
> 
> but with 5.6 it outputs the first 'a' and then loops forever.
> 
> $str = "abc";
> $|=1;
> while($str =~ /(c)|(b)|(a)/g) {
>   my $paren = 1;
>   print "$+ ";
>   $paren++ until defined ${$paren};
>   print "$paren\n";
> }
> 
> I know that in 5.6 I could use @- to do this, but I have this
> structure in code that is already in use and needs to continue
> to work with older versions of perl
> 
> Graham.
> 
> [Please do not change anything below this line]
> -----------------------------------------------------------------
> ---
> Flags:
>     category=core
>     severity=high
> ---
> Site configuration information for perl v5.6.0:
> 
> Configured by gbarr at Wed Mar 29 16:49:13 BST 2000.
> 
> Summary of my perl5 (revision 5.0 version 6 subversion 0) configuration:
>   Platform:
>     osname=linux, osvers=2.2.13, archname=i686-linux
>     uname='linux chipper 2.2.13 #1 mon nov 8 15:37:25 cet 1999 i686 unknown '
>     config_args='-des'
>     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='cc', optimize='-O2', gccversion=egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)
>     cppflags='-fno-strict-aliasing -I/usr/local/include'
>     ccflags ='-fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64'
>     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
>     ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
>     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 -ldbm -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'
> 
> Locally applied patches:
>     
> 
> ---
> @INC for perl v5.6.0:
>     /home/value/perl
>     /usr/local/lib/perl5/5.6.0/i686-linux
>     /usr/local/lib/perl5/5.6.0
>     /usr/local/lib/perl5/site_perl/5.6.0/i686-linux
>     /usr/local/lib/perl5/site_perl/5.6.0
>     /usr/local/lib/perl5/site_perl
>     .
> 
> ---
> Environment for perl v5.6.0:
>     HOME=/home/gbarr
>     LANG=POSIX
>     LANGUAGE (unset)
>     LD_LIBRARY_PATH (unset)
>     LOGDIR (unset)
>     PATH=/home/gbarr/bin:/usr/local/bin:/usr/bin:/usr/X11R6/bin:/bin:/usr/games/bin:/usr/games:/opt/gnome/bin:/opt/kde/bin:.
>     PERL5LIB=/home/value/perl
>     PERL_BADLANG (unset)
>     SHELL=/usr/bin/zsh

Thread Previous | 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