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

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

Thread Next
February 28, 2001 02:11
[ID 20010228.001] Fwd: Bug report: splice/stringification
Message ID:
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.

From: (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>
NNTP-Posting-Host: (
X-Trace: 983348630 26396854 (16 [45764])
User-Agent: slrn/ (Linux)
Xref: comp.lang.perl.misc:94338

To the p5p and anyone connected with

I have now tried to submit this bug report from three independent email
addresses to, only to be told in a bounce message that
I am sending email from a 'spam haven'. I can't even email 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

To the p5p: You better tell those idiots at 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];


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.


[Please do not change anything below this line]
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:
    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
    useperlio=undef d_sfio=undef uselargefiles=define 
    use64bitint=undef use64bitall=undef uselongdouble=undef usesocks=undef
    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
    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',
    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/, 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:

Environment for perl v5.6.0:
    LANGUAGE (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