Skip Menu |
Report information
Id: 1673
Status: resolved
Priority: 0/
Queue: perl5

Owner: Nobody
Requestors: ysth <sthoenna [at] efn.org>
Cc:
AdminCc:

Operating System: os2
PatchStatus: (no value)
Severity: medium
Type: notabug
Perl Version: (no value)
Fixed In: (no value)



From: sthoenna [...] efn.org (Yitzchak Scott-Thoennes)
To: perlbug [...] perl.com
Subject: hash iterator position not preserved by local
Date: Wed, 20 Oct 1999 23:36:36 -0700
Download (untitled) / with headers
text/plain 2.3k
----------------------------------------------------------------- [Please enter your report here] with code like: while (my ($k,$v) = each %ENV) { local %ENV; $r = keys %ENV; print "$k=$v\n" } the keys in the loop resets the iterator for the original %ENV hash, resulting in the each always returning the first key,value pair. [Please do not change anything below this line] ----------------------------------------------------------------- --- Site configuration information for perl 5.00553: Configured by ilya at Thu Nov 5 01:10:17 EST 1998. Summary of my perl5 (5.0 patchlevel 5 subversion 53) configuration: Platform: osname=os2, osvers=2.30, archname=os2 uname='os2 karetnikova 2 2.30 i386 ' hint=recommended, useposix=true, d_sigaction=define usethreads=undef useperlio=undef d_sfio=undef Compiler: cc='gcc', optimize='-O2 -fomit-frame-pointer -malign-loops=2 -malign-jumps=2 -malign-functions=2 -s', gccversion=2.7.2.1 cppflags='-Zomf -Zmt -DDOSISH -DOS2=2 -DEMBED -I.' ccflags ='-Zomf -Zmt -DDOSISH -DOS2=2 -DEMBED -I.' 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 alignbytes=4, usemymalloc=y, prototype=define Linker and Libraries: ld='gcc', ldflags ='-Zexe -Zomf -Zmt -Zcrtdll -Zstack 32000' libpth=d:/emx.add/lib d:/emx/lib D:/DEVTOOLS/OPENGL/LIB d:/emx/lib/mt libs=-lsocket -lm -lbsd libc=d:/emx/lib/mt/c_import.lib, so=dll, useshrplib=true, libperl=libperl.lib Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=dll, d_dlsymun=undef, ccdlflags=' ' cccdlflags='-Zdll', lddlflags='-Zdll -Zomf -Zmt -Zcrtdll -s' Locally applied patches: --- @INC for perl 5.00553: d:/PERLLIB/LIB/5.00553/os2 d:/PERLLIB/LIB/5.00553 d:/PERLLIB/LIB/site_perl/5.00553/os2 d:/PERLLIB/LIB/site_perl/5.00553 . --- Environment for perl 5.00553: HOME=d:\os2apps\yarn\user LANG=en_us LD_LIBRARY_PATH (unset) LOGDIR (unset) PATH=d:\bin;C:\OS2;C:\OS2\SYSTEM;C:\OS2\INSTALL;C:\;C:\OS2\MDOS;C:\OS2\APPS;C:\MMOS2;d:\os2apps\util;d:\DOSAPPS\UTIL;c:\sio;D:\WINDOWS;d:\pdksh;d:\emx\bin;d:\xfree86\bin;d:\emacs\19.33\bin;d:\ispell PERLLIB_PREFIX=F:/perllib/lib;d:\PERLLIB\LIB PERL_BADLANG (unset) PERL_SH_DIR=d:\BIN SHELL (unset)
This is more than likely a misunderstanding between the use of local() and my().


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at perl.org