develooper Front page | perl.perl5.porters | Postings from June 2015

[perl #125493] "Replacement list is longer than search list" is warned even if search list is in range of ASCII

From:
perlbug-followup
Date:
June 27, 2015 06:17
Subject:
[perl #125493] "Replacement list is longer than search list" is warned even if search list is in range of ASCII
Message ID:
rt-4.0.18-8190-1435365200-892.125493-75-0@perl.org
# New Ticket Created by   
# Please include the string:  [perl #125493]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org/Ticket/Display.html?id=125493 >



This is a bug report for perl from nezumi@cpan.org,
generated with the help of perlbug 1.40 running under perl 5.22.0.


-----------------------------------------------------------------
[Please describe your issue here]

As of 5.21.6, "Replacement list is longer than search list" warning seems
enabled on wide characters.  However, it is enabled even if search list
contains only ASCII.

------------ >8 ------------ >8 ------------ >8 ------------
PERLIO=utf8 /usr/local/perl-5.22.0/bin/perl <<'EOF'
use warnings;
$_="3.14159";
tr/0-9/\x{6F0}-\x{6F9}/;
print $_;
EOF

Replacement list is longer than search list at - line 3.
۳.۱۴۱۵۹
------------ 8< ------------ 8< ------------ 8< ------------

If the 3rd line of code above does not contain "-", or if search list in it
contains wide character, warning is not shown, e.g.:

  tr/09/\x{6F0}\x{6F9}/;
  tr/\x{6F0}-\x{6F9}/\x{116C0}-\x{116C9}/;

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

Configured by xxxxxxxx at Sat Jun 27 09:00:54 JST 2015.

Summary of my perl5 (revision 5 version 22 subversion 0) configuration:
   
  Platform:
    osname=linux, osvers=2.6.32-504.23.4.el6.i686, archname=i686-linux
    uname='linux xxx.xxx.xxx 2.6.32-504.23.4.el6.i686 #1 smp tue jun 9 18:09:42 utc 2015 i686 i686 i386 gnulinux '
    config_args='-de -Dprefix=/usr/local/perl-5.22.0'
    hint=recommended, useposix=true, d_sigaction=define
    useithreads=undef, usemultiplicity=undef
    use64bitint=undef, use64bitall=undef, uselongdouble=undef
    usemymalloc=n, bincompat5005=undef
  Compiler:
    cc='cc', ccflags ='-fwrapv -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2',
    optimize='-O2',
    cppflags='-fwrapv -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include'
    ccversion='', gccversion='4.4.7 20120313 (Red Hat 4.4.7-11)', gccosandvers=''
    intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234, doublekind=3
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12, longdblkind=3
    ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
    alignbytes=4, prototype=define
  Linker and Libraries:
    ld='cc', ldflags =' -fstack-protector -L/usr/local/lib'
    libpth=/usr/local/lib /usr/lib /lib
    libs=-lpthread -lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc
    perllibs=-lpthread -lnsl -ldl -lm -lcrypt -lutil -lc
    libc=libc-2.12.so, so=so, useshrplib=false, libperl=libperl.a
    gnulibc_version='2.12'
  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'


---
@INC for perl 5.22.0:
    /usr/local/perl-5.22.0/lib/site_perl/5.22.0/i686-linux
    /usr/local/perl-5.22.0/lib/site_perl/5.22.0
    /usr/local/perl-5.22.0/lib/5.22.0/i686-linux
    /usr/local/perl-5.22.0/lib/5.22.0
    .

---
Environment for perl 5.22.0:
    HOME=/home/xxxxxxxx
    LANG=ja_JP.utf8
    LANGUAGE (unset)
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PATH=/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/xxxxxxxx/bin
    PERL_BADLANG (unset)
    SHELL=/bin/bash




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