develooper Front page | perl.perl5.porters | Postings from February 2001

[ID 20010228.001] Fwd: Bug report: splice/stringification

Thread Next
From:
b.judd
Date:
February 28, 2001 02:11
Subject:
[ID 20010228.001] Fwd: Bug report: splice/stringification
Message ID:
200102281010.XAA23409@thislove.dyndns.org
This is the content of a message posted to clpm. I have nothing to do
whatsoever with the poster, I just thought it should be passed on.
Thanks.

Path: news.xtra.co.nz!codeine.org!fr.usenet-edu.net!usenet-edu.net!fu-berlin.de!uni-berlin.de!cyber-141.speednet.com.AU!not-for-mail
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Newsgroups: comp.lang.perl.misc
Subject: Bug report: splice/stringification
Date: Wed, 28 Feb 2001 19:13:59 +1100
Organization: Heliotrope Productions Pty. Ltd.
Lines: 170
Message-ID: <slrn99pcq7.8ue.mgjv@martien.heliotrope.home>
Reply-To: mgjv@tradingpost.com.au
NNTP-Posting-Host: cyber-141.speednet.com.au (202.135.188.190)
X-Trace: fu-berlin.de 983348630 26396854 202.135.188.190 (16 [45764])
X-Real-Address: mgjv@tradingpost.com.au
User-Agent: slrn/0.9.6.3pl4 (Linux)
Xref: news.xtra.co.nz comp.lang.perl.misc:94338

To the p5p and anyone connected with perl.com:

I have now tried to submit this bug report from three independent email
addresses to perlbug@perl.com, only to be told in a bounce message that
I am sending email from a 'spam haven'. I can't even email
postmaster@perl.com to complain about this puerile message, because it
bounces with the same message. An email sent from some web account to
the postmaster there has not had a response in two days, so I am giving
up.

To the p5p: You better tell those idiots at perl.com to shape up. None
of the addresses of the MTA hosts I posted through is listed in the DUL,
MAPS or ORBS.  Whatever stuff they're running there is too fascist, and
ridiculously infantile, and obviously not even kept up to date. I'm
posting the bug report here in the hope that one of you picks it up and
files it. If not, so be it.

I frankly have wasted more than enough time on getting a simple bug
report in. I just wonder how many other people out there are having the
same problems I am having.

And yes, my sendmail is configured correctly. And yes, I am pissed off
about this.


This is a bug report for perl from mgjv@martien.heliotrope.home,
generated with the help of perlbug 1.28 running under perl v5.6.0.


-----------------------------------------------------------------
This problem came to my notice after a discussion on clp.misc about some
problems being reported by Joe Pepin. It was decided that I would file
the bug report, instead of him.

It seems that the return list from splice is influenced by whether or
not the source array's elements have been stringified before the call to
splice. This is even true if the original elements were already strings.
The following program and its output may illustrate what I mean:

#!/usr/local/bin/perl -wl
use strict;
{
	my @a = (1, 2, 3, 4, 5, 6, 7, 8);
	my @foo = @a;
	print join ":", map {$_ || "undef"} splice @a, 0, 4, @a[2,3];
}
{
	my @a = (1, 2, 3, 4, 5, 6, 7, 8);
	my $foo = $_ for @a;
	print join ":", map {$_ || "undef"} splice @a, 0, 4, @a[2,3];
}
{
	my @a = (1, 2, 3, 4, 5, 6, 7, 8);
	my $foo = "@a";
	print join ":", map {$_ || "undef"} splice @a, 0, 4, @a[2,3];
}
{
	my @a = (1, 2, 3, 4, 5, 6, 7, 8);
	my $foo = "$_" for @a;
	print join ":", map {$_ || "undef"} splice @a, 0, 4, @a[2,3];
}
{
	my @a = qw(a b c d e f g);
	my $foo = "$_" for @a;
	print join ":", map {$_ || "undef"} splice @a, 0, 4, @a[2,3];
}
__END__

OUTPUT:
1:2:3:4
1:2:3:4
1:2:undef:undef
1:2:undef:undef
a:b:undef:undef

Changing the order of the blocks makes no difference.

It seems hardly logical to me that the result of these operations should
differ, based on whether the elements of @a had been stringified before
or not, especially if they were already strings.

Martien

[Please do not change anything below this line]
-----------------------------------------------------------------
---
Flags:
    category=core
    severity=low
---
Site configuration information for perl v5.6.0:

Configured by mgjv at Sat Mar 25 17:48:49 EST 2000.

Summary of my perl5 (revision 5.0 version 6 subversion 0) configuration:
  Platform:
    osname=linux, osvers=2.2.12-20, archname=i686-linux
    uname='linux martien 2.2.12-20 #1 mon sep 27 10:40:35 edt 1999 i686
unknown '
    config_args='-des -Dprefix=/opt/perl'
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=undef use5005threads=undef useithreads=undef
usemultiplicity=undef
    useperlio=undef d_sfio=undef uselargefiles=define 
    use64bitint=undef use64bitall=undef uselongdouble=undef usesocks=undef
  Compiler:
    cc='cc', optimize='-O2', gccversion=egcs-2.91.66 19990314/Linux
(egcs-1.1.2 release)
    cppflags='-fno-strict-aliasing -I/usr/local/include'
    ccflags ='-fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE
-D_FILE_OFFSET_BITS=64'
    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
    ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t',
lseeksize=8
    alignbytes=4, usemymalloc=n, 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
    libc=/lib/libc-2.1.2.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:
    

---
@INC for perl v5.6.0:
    /opt/perl/lib/5.6.0/i686-linux
    /opt/perl/lib/5.6.0
    /opt/perl/lib/site_perl/5.6.0/i686-linux
    /opt/perl/lib/site_perl/5.6.0
    /opt/perl/lib/site_perl/5.005/i686-linux
    /opt/perl/lib/site_perl/5.005
    /opt/perl/lib/site_perl
    .

---
Environment for perl v5.6.0:
    HOME=/home/mgjv
    LANG=en_US
    LANGUAGE (unset)
    LD_LIBRARY_PATH=/opt/3delight-0.6.0/Linux-i686/lib:/opt/pgplot:/opt/post
gresql/lib:/opt/gimp/lib
    LOGDIR (unset)
    PATH=/home/mgjv/bin:/opt/3delight-0.6.0/Linux-i686/bin:/opt/teTeX/bin:/u
sr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/X11R6/bin:/usr/openwin/bin:/
usr/openwin/demo:/opt/samba/bin:/usr/local/ssl/bin:/opt/perl/bin:/opt/ImageM
agick/bin:/opt/java/bin:/opt/mysql/bin:/opt/postgresql/bin:/opt/gimp/bin:/op
t/BMRT/bin:/opt/3delight/Linux-i686/bin:/opt/wordnet/bin
    PERL_BADLANG (unset)
    SHELL=/bin/tcsh



Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About