develooper Front page | perl.perl5.porters | Postings from November 2003

[perl #24435] setting multiple blank references using multipliers ties them together

Thread Next
Jereme Claussen
November 6, 2003 19:01
[perl #24435] setting multiple blank references using multipliers ties them together
Message ID:
# New Ticket Created by  Jereme Claussen 
# Please include the string:  [perl #24435]
# in the subject line of all future correspondence about this issue. 
# <URL: >

This is a bug report for perl from,
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:
    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
    useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
    use64bitint=undef use64bitall=undef uselongdouble=undef
    usemymalloc=n, bincompat5005=undef
    cc='gcc', ccflags ='-D_REENTRANT -fno-strict-aliasing
    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',
    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/, so=so, useshrplib=false, libperl=libperl.a
  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:

Environment for perl 5.008:
    LANG (unset)
    LOGDIR (unset)
    PERL_BADLANG (unset)

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About