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

[ID 20000225.006] redo undefines variables declared like while(my $i ...) { redo; }

From:
khw
Date:
February 25, 2000 10:35
Subject:
[ID 20000225.006] redo undefines variables declared like while(my $i ...) { redo; }
Message ID:
200002251834.LAA19929@drgpaxon

This is a bug report for perl from khwilliamson@lucent.com,
generated with the help of perlbug 1.26 running under perl 5.00503.


-----------------------------------------------------------------
The following program is an example:

use strict;
my @A = ( 1, 2, 3);
#my $i;
while (my $i = shift @A) {
	print "i=$i\n";
	last unless defined $i;
	redo;
}

Different results occur if $i is declared outside the while
statement (it works) than as shown above.  The redo causes
$i to become undefined.
-----------------------------------------------------------------

---
Site configuration information for perl 5.00503:

Configured by expmake at Fri Sep 10 16:33:51 CDT 1999.

Summary of my perl5 (5.0 patchlevel 5 subversion 3) configuration:
  Platform:
    osname=solaris, osvers=2.4, archname=sun4-solaris
    uname='sunos nwpep 5.4 generic_101945-61 sun4d sparc '
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=undef useperlio=undef d_sfio=undef
  Compiler:
    cc='cc', optimize='-O', gccversion=
    cppflags=''
    ccflags =''
    stdchar='unsigned 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='cc', ldflags =''
    libpth=/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='-KPIC', lddlflags='-G'

Locally applied patches:
    

---
@INC for perl 5.00503:
    /opt/exp/perl/lib/5.00503/sun4-solaris
    /opt/exp/perl/lib/5.00503
    /opt/exp/perl/lib/site_perl/5.005/sun4-solaris
    /opt/exp/perl/lib/site_perl/5.005
    .

---
Environment for perl 5.00503:
    HOME=/home/khw
    LANG (unset)
    LANGUAGE (unset)
    LD_LIBRARY_PATH=/usr/openwin/lib:/usr/lib
    LOGDIR (unset)
    PATH=/usr/local/src/post/src/post:/home/khw/specbin:/home/khw/bin:/home/khw/print/bin:/usr/add-on/dwb/bin:/usr/5bin:/usr/ucb:/usr/add-on/local/bin:/usr/add-on/unison/bin:/opt/exp/bin:/usr/sbin:/usr/add-on/zmail/bin:/usr/add-on/ncmp/630/bin:/usr/add-on/SUNWspro/bin:/usr/openwin/bin:/usr/openwin/demo:/usr/bin/X11:/usr/add-on/ncmp/bin:/usr/ccs/bin:/etc:/usr/add-on/defty5/bin:/usr/add-on/tools/bin:/opt/exp/perl/bin:
    PERL_BADLANG (unset)
    SHELL=/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