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

[perl #24069] Strange ++substr behaviour

Thread Next
From:
perlbug-followup
Date:
September 29, 2003 20:27
Subject:
[perl #24069] Strange ++substr behaviour
Message ID:
rt-24069-65421.9.4578547354736@rt.perl.org
# New Ticket Created by  book@mongueurs.net 
# Please include the string:  [perl #24069]
# in the subject line of all future correspondence about this issue. 
# <URL: http://rt.perl.org/rt2/Ticket/Display.html?id=24069 >



This is a bug report for perl from book@mongueurs.net,
generated with the help of perlbug 1.34 running under perl v5.8.0.


-----------------------------------------------------------------
[Please enter your report here]

Hello,

The following program

    my $c = "bzr";
    print ++substr($c, 1, 1), " $c";

ouputs

    a baar

when I think it should really output

    aa baar

Just like the following

    my $c = 'z';
    print ++$c;

(as expected) does

    aa


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

Configured by root at Wed Oct 16 23:02:33 CEST 2002.

Summary of my perl5 (revision 5.0 version 8 subversion 0) configuration:
  Platform:
    osname=linux, osvers=2.2.20, archname=i686-linux
    uname='linux rose 2.2.20 #3 smp mon jul 15 02:31:00 cest 2002 i686 unknown unknown gnulinux '
    config_args='-Uinstallusrbinperl -Dprefix=/home/perl'
    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=undef
  Compiler:
    cc='cc', ccflags ='-fno-strict-aliasing -I/usr/local/include -DDEBUGGING -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
    optimize='-O3',
    cppflags='-fno-strict-aliasing -I/usr/local/include -DDEBUGGING'
    ccversion='', gccversion='2.95.4 20011002 (Debian prerelease)', 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 -ldl -lm -lc -lcrypt -lutil
    perllibs=-lnsl -ldl -lm -lc -lcrypt -lutil
    libc=/lib/libc-2.2.5.so, so=so, useshrplib=false, libperl=libperl.a
    gnulibc_version='2.2.5'
  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.8.0:
    /home/book/sources/perl
    /home/book/bin/perl
    /home/perl/lib/5.8.0/i686-linux
    /home/perl/lib/5.8.0
    /home/perl/lib/site_perl/5.8.0/i686-linux
    /home/perl/lib/site_perl/5.8.0
    /home/perl/lib/site_perl
    .

---
Environment for perl v5.8.0:
    HOME=/home/book
    LANG=fr_FR@euro
    LANGUAGE (unset)
    LC_ALL=french
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PATH=/home/book/bin:/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/games:/usr/games:/usr/local/games:/usr/local/lib/jdk/bin:.
    PERL5LIB=/home/book/sources/perl:/home/book/bin/perl
    PERL_BADLANG (unset)
    SHELL=/bin/bash


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