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

Owner: Nobody
Requestors: jefpin [at] towers.crusoe.net
Cc:
AdminCc:

Operating System: All
PatchStatus: (no value)
Severity: medium
Type: core
Perl Version: 5.8.1
Fixed In: 5.8.1



Date: Sun, 13 Jan 2002 10:43:09 -0500
From: Jeff Pinyan <jefpin [...] towers.crusoe.net>
To: perlbug [...] perl.org
Subject: global used where lexical was expected
Download (untitled) / with headers
text/plain 3.2k
This is a bug report for perl from jefpin@towers.crusoe.net, generated with the help of perlbug 1.33 running under perl v5.7.2. ----------------------------------------------------------------- [Please enter your report here] Perl is using the global $x where I expected it to use the lexical $x instead. jefpin@towers [10:36am] ~ #219> bleadperl $x = "THIS"; my $x = "THAT"; print "${x} ${x}[2]\n"; __END__ THAT THIS[2] It has to do with the fact that the next character is "[" or "{". And when I introduce a lexically-scoped @x, then "${x}[2]" is rendered as just "[2]". jefpin@towers [10:36am] ~ #219> bleadperl $x = "THIS"; my $x = "THAT"; my @x = (1..5); print "${x} ${x}[2]\n"; __END__ THAT [2] This does not feel right to me. Perhaps this is a case of one of those weighting mechanisms (where Perl decides what to render a variable-type thing as) failing? [Please do not change anything below this line] ----------------------------------------------------------------- --- Flags: category=core severity=medium --- Site configuration information for perl v5.7.2: Configured by jefpin at Sun Jan 6 01:49:30 EST 2002. Summary of my perl5 (revision 5.0 version 7 subversion 2 patch 14101) configuration: Platform: osname=linux, osvers=2.2.16-3, archname=i586-linux uname='linux towers.crusoe.net 2.2.16-3 #5 sat jul 8 11:42:18 edt 2000 i586 unknown ' config_args='-DDEBUGGING -Dusedevel -Dprefix=/tmp/bleadperl -de' hint=recommended, useposix=true, d_sigaction=define usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef useperlio=define d_sfio=undef uselargefiles=define usesocks=undef use64bitint=undef use64bitall=undef uselongdouble=undef usemymalloc=n, bincompat5005=define Compiler: cc='cc', ccflags ='-fno-strict-aliasing -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64', optimize='-O2', cppflags='-fno-strict-aliasing' ccversion='', gccversion='egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)', gccosandvers='' intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234 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, 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 -lutil perllibs=-lnsl -ldl -lm -lc -lposix -lcrypt -lutil libc=/lib/libc-2.1.3.so, 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: DEVEL14041 --- @INC for perl v5.7.2: /tmp/bleadperl/lib/5.7.2/i586-linux /tmp/bleadperl/lib/5.7.2 /tmp/bleadperl/lib/site_perl/5.7.2/i586-linux /tmp/bleadperl/lib/site_perl/5.7.2 /tmp/bleadperl/lib/site_perl . --- Environment for perl v5.7.2: HOME=/home/jefpin LANG=en_US LANGUAGE (unset) LD_LIBRARY_PATH (unset) LOGDIR (unset) PATH=/usr/bin:/bin:/usr/local/bin:/usr/X11R6/bin:/home/jefpin/bin:/tmp/bleadperl/bin PERL_BADLANG (unset) SHELL=/bin/tcsh
Download (untitled) / with headers
text/plain 141b
(Just reviewing old Perl bugs). This appears to be fixed in bleedperl by patch #18753, and in 5.8.1-tobe by patch #18783. Regards, Dave M.


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