Front page | perl.perl5.porters |
Postings from November 2003
[perl #24435] setting multiple blank references using multipliers ties them together
Thread Next
From:
Jereme Claussen
Date:
November 6, 2003 19:01
Subject:
[perl #24435] setting multiple blank references using multipliers ties them together
Message ID:
rt-24435-67191.19.6176128977421@rt.perl.org
# New Ticket Created by Jereme Claussen
# Please include the string: [perl #24435]
# in the subject line of all future correspondence about this issue.
# <URL: http://rt.perl.org/rt2/Ticket/Display.html?id=24435 >
This is a bug report for perl from jtc@bmnetwerks.net,
generated with the help of perlbug 1.26 running under perl 5.008.
-----------------------------------------------------------------
Trying to create multiple blank references on one line, like so:
my($var1 , $var2 , $var3) = ([])x3;
Ties them together in such a way that doing:
push($var1,"Foo bar.");
Will actually push that on to $var2 and $var3 as well. The same
holds true with hashrefs in that:
my($var1 , $var2 , $var3) = ({})x3;
$var1->{"foo"} = "bar";
Then $var2->{"foo"} eq "bar" and $var3->{"foo"} eq "bar".
To increase the level of odd behaviour in this, if you do:
my($var1 , $var2 , $var3 , $var4) = ({},{})x2;
$var1->{"foo"} = "bar";
It will be set in $var1 and $var3, but not 2 and 4.
This behaviour is consistant on perl 5.004 and 5.6.1 as well.
-----------------------------------------------------------------
---
This perlbug was built using Perl 5.00502 - Tue Feb 16 14:57:39 EST 1999
It is being executed now by Perl 5.008 - Thu Apr 24 22:15:35 PDT 2003.
Site configuration information for perl 5.008:
Configured by chris at Thu Apr 24 22:15:35 PDT 2003.
Summary of my perl5 (revision 5.0 version 8 subversion 0) configuration:
Platform:
osname=solaris, osvers=2.7, archname=sun4-solaris-thread-multi
uname='sunos carol 5.7 generic_106541-23 sun4u sparc
sunw,ultra-enterprise '
config_args='-de -Dusethreads -Dcc=gcc'
hint=recommended, useposix=true, d_sigaction=define
usethreads=define use5005threads=undef useithreads=define
usemultiplicity=define
useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
use64bitint=undef use64bitall=undef uselongdouble=undef
usemymalloc=n, bincompat5005=undef
Compiler:
cc='gcc', ccflags ='-D_REENTRANT -fno-strict-aliasing
-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
optimize='-O',
cppflags='-D_REENTRANT -fno-strict-aliasing'
ccversion='', gccversion='3.0.4', gccosandvers='solaris2.7'
intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=4321
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t',
lseeksize=8
alignbytes=8, prototype=define
Linker and Libraries:
ld='gcc', ldflags =' -L/usr/local/lib '
libpth=/usr/local/lib /usr/lib /usr/ccs/lib
libs=-lsocket -lnsl -lgdbm -ldb -ldl -lm -lrt -lpthread -lc
perllibs=-lsocket -lnsl -ldl -lm -lrt -lpthread -lc
libc=/lib/libc.so, so=so, useshrplib=false, libperl=libperl.a
gnulibc_version=''
Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' -Wl,-E'
cccdlflags='-fPIC', lddlflags=' -Wl,-E -G -L/usr/local/lib'
Locally applied patches:
---
@INC for perl 5.008:
/home/jereme/lib/5.6.0
/home/jereme/lib
/usr/local/lib/perl5/5.8.0/sun4-solaris-thread-multi
/usr/local/lib/perl5/5.8.0
/usr/local/lib/perl5/site_perl/5.8.0/sun4-solaris-thread-multi
/usr/local/lib/perl5/site_perl/5.8.0
/usr/local/lib/perl5/site_perl/5.6.0
/usr/local/lib/perl5/site_perl/5.005
/usr/local/lib/perl5/site_perl
.
---
Environment for perl 5.008:
HOME=/home/jereme
LANG (unset)
LD_LIBRARY_PATH=/usr/local/qt/lib:/usr/local/lib:/usr/local/mysql/lib
LOGDIR (unset)
PATH=/usr/local/qt/bin:/usr/local/mysql/bin:/opt/SUNWppro/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/bin:/usr/ccs/bin:/usr/local/bin:/usr/local/script:/usr/sbin:/home/joel/bin:/usr/local/apache/share:/home/jereme/lib
PERL5LIB=/home/jereme/lib
PERL_BADLANG (unset)
SHELL=/usr/local/bin/bash
Thread Next
-
[perl #24435] setting multiple blank references using multipliers ties them together
by Jereme Claussen