[perl #75596] Iterator not reset on array assignment

[email protected] (perl @ profvince . com)
Newsgroups perl.perl5.porters
Message-ID <[email protected]>
# New Ticket Created by  [email protected] 
# Please include the string:  [perl #75596]
# in the subject line of all future correspondence about this issue. 
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=75596 >


This is a bug report for perl from [email protected],
generated with the help of perlbug 1.39 running under perl 5.10.1.


-----------------------------------------------------------------
[Please describe your issue here]

Perl doesn't reset the array iterator when the array is cleared :

    $ perl5.12.1-64 -M5.012 -E 'my @a = "a" .. "c"; my ($i, $v) = each @a; say "$i: $v"; @a = "A" .. "C"; ($i, $v) = each @a; say "$i: $v"'
    0: a
    1: B

The issue is still present in 5.13.1.

Vincent.

[Please do not change anything below this line]
-----------------------------------------------------------------
---
Flags:
    category=core
    severity=medium
---
Site configuration information for perl 5.10.1:

Configured by Gentoo at Sat Feb 13 19:44:25 CET 2010.

Summary of my perl5 (revision 5 version 10 subversion 1) configuration:
   
  Platform:
    osname=linux, osvers=2.6.32.7-fuuka.profvince.com, archname=x86_64-linux
    uname='linux fuuka 2.6.32.7-fuuka.profvince.com #1 smp sat jan 30 18:37:12 cet 2010 x86_64 intel(r) core(tm)2 duo cpu e6750 @ 2.66ghz genuineintel gnulinux '
    config_args='-des -Duseshrplib -Darchname=x86_64-linux -Dcc=x86_64-pc-linux-gnu-gcc -Doptimize=-march=core2 -O3 -fomit-frame-pointer -ftree-vectorize -ftree-vectorizer-verbose=1 -pipe -DNDEBUG -Dscriptdir=/usr/bin -Dprefix=/usr -Dvendorprefix=/usr -Dsiteprefix=/usr -Dprivlib=/usr/lib64/perl5/5.10.1 -Darchlib=/usr/lib64/perl5/5.10.1/x86_64-linux -Dvendorlib=/usr/lib64/perl5/vendor_perl/5.10.1 -Dvendorarch=/usr/lib64/perl5/vendor_perl/5.10.1/x86_64-linux -Dsitelib=/usr/lib64/perl5/site_perl/5.10.1 -Dsitearch=/usr/lib64/perl5/site_perl/5.10.1/x86_64-linux -Dman1dir=/usr/share/man/man1 -Dman3dir=/usr/share/man/man3 -Dinstallman1dir=/usr/share/man/man1 -Dinstallman3dir=/usr/share/man/man3 -Dman1ext=1 -Dman3ext=3pm -Dlibperl=libperl.so.5.10.1 -Dlocincpth=  -Duselargefiles -Dd_semctl_semun -Dinc_version_list=5.10.0 5.10.0/x86_64-linux -Dcf_by=Gentoo -Dmyhostname=localhost -Dperladmin=root@localhost -Dinstallusrbinperl=n -Ud_csh -Uusenm -Di_ndbm -Di_gdbm -Di_db -Dusrinc=/usr/incl
 ude -Dlibpth=/usr/local/lib64 /lib64 /usr/lib64'
    hint=recommended, useposix=true, d_sigaction=define
    useithreads=undef, usemultiplicity=undef
    useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
    use64bitint=define, use64bitall=define, uselongdouble=undef
    usemymalloc=n, bincompat5005=undef
  Compiler:
    cc='x86_64-pc-linux-gnu-gcc', ccflags ='-fno-strict-aliasing -pipe -fstack-protector -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
    optimize='-march=core2 -O3 -fomit-frame-pointer -ftree-vectorize -ftree-vectorizer-verbose=1 -pipe -DNDEBUG',
    cppflags='-fno-strict-aliasing -pipe -fstack-protector'
    ccversion='', gccversion='4.4.3', gccosandvers=''
    intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
    ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
    alignbytes=8, prototype=define
  Linker and Libraries:
    ld='x86_64-pc-linux-gnu-gcc', ldflags =' -fstack-protector'
    libpth=/usr/local/lib64 /lib64 /usr/lib64
    libs=-lpthread -lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc -lgdbm_compat
    perllibs=-lpthread -lnsl -ldl -lm -lcrypt -lutil -lc
    libc=/lib/libc-2.11.so, so=so, useshrplib=true, libperl=libperl.so.5.10.1
    gnulibc_version='2.11'
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E'
    cccdlflags='-fPIC', lddlflags='-shared -march=core2 -O3 -fomit-frame-pointer -ftree-vectorize -ftree-vectorizer-verbose=1 -pipe -DNDEBUG -fstack-protector'

Locally applied patches:
    

---
@INC for perl 5.10.1:
    /usr/lib64/perl5/site_perl/5.10.1/x86_64-linux
    /usr/lib64/perl5/site_perl/5.10.1
    /usr/lib64/perl5/site_perl
    /usr/lib64/perl5/vendor_perl/5.10.1/x86_64-linux
    /usr/lib64/perl5/vendor_perl/5.10.1
    /usr/lib64/perl5/vendor_perl
    /usr/lib64/perl5/5.10.1/x86_64-linux
    /usr/lib64/perl5/5.10.1
    .

---
Environment for perl 5.10.1:
    HOME=/home/vince
    LANG=fr_FR.UTF-8
    LANGUAGE (unset)
    LC_ALL=fr_FR.UTF-8
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PATH=/home/vince/bin:/home/vince/perl/builds/bin:/usr/local/bin:/usr/bin:/bin:/opt/bin:/usr/x86_64-pc-linux-gnu/gcc-bin/4.4.3:/opt/intel/cce/10.1.018/bin:/usr/games/bin
    PERL_BADLANG (unset)
    SHELL=/bin/bash
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.