develooper Front page | perl.perl5.porters | Postings from December 2012

[perl #116086] split "\x20" doesn't work as documented

Thread Next
From:
Daniel Lukasiak
Date:
December 16, 2012 07:13
Subject:
[perl #116086] split "\x20" doesn't work as documented
Message ID:
rt-3.6.HEAD-17500-1355419953-1494.116086-75-0@perl.org
# New Ticket Created by  Daniel Lukasiak 
# Please include the string:  [perl #116086]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org:443/rt3/Ticket/Display.html?id=116086 >


This is a bug report for perl from estrai@estrai.com,
generated with the help of perlbug 1.39 running under perl 5.17.7.


-----------------------------------------------------------------

Hi,
split() has a special case for " " and "\x20" so they work like \s+
(see perldoc -f split for details)
In blead (also observed on 5.17.5) "\x20" doesn't seem to work as documented.

 * " " works as expected:

% perl -MData::Dumper -E '$_="  a   b c   "; print Dumper [ split " " ]'
$VAR1 = [
          'a',
          'b',
          'c'
        ];

 * "\x20" doesn't:

% perl -MData::Dumper -E '$_="  a   b c   "; print Dumper [ split "\x20" ]'
$VAR1 = [
          '',
          '',
          'a',
          '',
          '',
          'b',
          'c'
        ];

estrai.

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

Configured by estrai at Thu Dec 13 15:39:20 GMT 2012.

Summary of my perl5 (revision 5 version 17 subversion 7) configuration:
  Snapshot of: 71446f2da4f4887cb6b60b4ddee4754faee70d3d
  Platform:
    osname=linux, osvers=2.6.32-5-amd64, archname=x86_64-linux
    uname='linux roar 2.6.32-5-amd64 #1 smp sun sep 23 10:07:46 utc
2012 x86_64 gnulinux '
    config_args='-de
-Dprefix=/home/estrai/perl5/perlbrew/perls/perl-blead -Dusedevel
-Aeval:scriptdir=/home/estrai/perl5/perlbrew/perls/perl-blead/bin'
    hint=recommended, useposix=true, d_sigaction=define
    useithreads=undef, usemultiplicity=undef
    useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
    use64bitint=define, use64bitall=define, uselongdouble=undef
    usemymalloc=n, bincompat5005=undef
  Compiler:
    cc='cc', ccflags ='-fno-strict-aliasing -pipe -fstack-protector
-I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
    optimize='-O2',
    cppflags='-fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include'
    ccversion='', gccversion='4.4.5', gccosandvers=''
    intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
    ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t',
lseeksize=8
    alignbytes=8, prototype=define
  Linker and Libraries:
    ld='cc', ldflags =' -fstack-protector -L/usr/local/lib'
    libpth=/usr/local/lib /lib/../lib /usr/lib/../lib /lib /usr/lib
/usr/lib/x86_64-linux-gnu /lib64 /usr/lib64
    libs=-lnsl -ldb -ldl -lm -lcrypt -lutil -lc
    perllibs=-lnsl -ldl -lm -lcrypt -lutil -lc
    libc=/lib/libc-2.11.3.so, so=so, useshrplib=false, libperl=libperl.a
    gnulibc_version='2.11.3'
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E'
    cccdlflags='-fPIC', lddlflags='-shared -O2 -L/usr/local/lib
-fstack-protector'

Locally applied patches:


---
@INC for perl 5.17.7:
    /home/estrai/perl5/perlbrew/perls/perl-blead/lib/site_perl/5.17.7/x86_64-linux
    /home/estrai/perl5/perlbrew/perls/perl-blead/lib/site_perl/5.17.7
    /home/estrai/perl5/perlbrew/perls/perl-blead/lib/5.17.7/x86_64-linux
    /home/estrai/perl5/perlbrew/perls/perl-blead/lib/5.17.7
    .

---
Environment for perl 5.17.7:
    HOME=/home/estrai
    LANG=en_GB.utf8
    LANGUAGE (unset)
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PATH=/home/estrai/perl5/perlbrew/bin:/home/estrai/perl5/perlbrew/perls/perl-blead/bin:/home/estrai/.rbenv/shims:/home/estrai/bin:/Applications/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin:/usr/X11/bin:/home/estrai/.rbenv/shims:/home/estrai/bin:/Applications/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin:/usr/X11/bin:/home/estrai/bin:/Application/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/home/estrai/.rbenv/bin:/home/estrai/.rbenv/bin
    PERLBREW_BASHRC_VERSION=0.53
    PERLBREW_HOME=/home/estrai/.perlbrew
    PERLBREW_MANPATH=/home/estrai/perl5/perlbrew/perls/perl-blead/man
    PERLBREW_PATH=/home/estrai/perl5/perlbrew/bin:/home/estrai/perl5/perlbrew/perls/perl-blead/bin
    PERLBREW_PERL=perl-blead
    PERLBREW_ROOT=/home/estrai/perl5/perlbrew
    PERLBREW_VERSION=0.53
    PERL_BADLANG (unset)
    SHELL=/usr/bin/zsh


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