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

[ID 20010706.002] utf8 lc($1) bohrbug under 5.6

From:
Sean M. Burke
Date:
July 6, 2001 02:17
Subject:
[ID 20010706.002] utf8 lc($1) bohrbug under 5.6
Message ID:
3.0.6.32.20010706031800.0079a720@mail.spinn.net
This:

use utf8;
foreach my $x ( ("POTATOES") x 3 ) {
  print lc($1), " < $x / " if $x =~ m/^(\w*)/s;
}

prints:

potatoes < POTATOES / 00c0[ascii 0x00]oes < POTATOES / potatoes < POTATOES /

                      ^^^^^^^^^^^^^^^^^^^ odd!


Remove the "use utf8" line, and the bug goes away.
Change lc($1) to lc("$1"), and the bug goes away.
I'm scared!!


Summary of my perl5 (revision 5 version 6 subversion 0) configuration:
  Platform:
    osname=MSWin32, osvers=4.0, archname=MSWin32-x86-multi-thread
    uname=''
    config_args='undef'
    hint=recommended, useposix=true, d_sigaction=undef
    usethreads=undef use5005threads=undef useithreads=define usemultiplicity=define
    useperlio=undef d_sfio=undef uselargefiles=undef 
    use64bitint=undef use64bitall=undef uselongdouble=undef usesocks=undef
  Compiler:
    cc='cl', optimize='-O1 -MD -DNDEBUG', gccversion=
    cppflags='-DWIN32'
    ccflags ='-O1 -MD -DNDEBUG -DWIN32 -D_CONSOLE -DNO_STRICT -DHAVE_DES_FCRYPT  -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DPERL_MSVCRT_READFIX'
    stdchar='char', d_stdstdio=define, usevfork=false
    intsize=4, longsize=4, ptrsize=4, doublesize=8
    d_longlong=undef, longlongsize=8, d_longdbl=define, longdblsize=10
    ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=4
    alignbytes=8, usemymalloc=n, prototype=define
  Linker and Libraries:
    ld='link', ldflags ='-nologo -nodefaultlib -release  -libpath:"c:\Perl\lib\CORE"  -machine:x86'
    libpth="c:\Perl\lib\CORE"
    libs=  oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib  comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib  netapi32.lib uuid.lib wsock32.lib mpr.lib winmm.lib  version.lib odbc32.lib odbccp32.lib msvcrt.lib
    libc=msvcrt.lib, so=dll, useshrplib=yes, libperl=perl56.lib
  Dynamic Linking:
    dlsrc=dl_win32.xs, dlext=dll, d_dlsymun=undef, ccdlflags=' '
    cccdlflags=' ', lddlflags='-dll -nologo -nodefaultlib -release  -libpath:"c:\Perl\lib\CORE"  -machine:x86'


Characteristics of this binary (from libperl): 
  Compile-time options: MULTIPLICITY USE_ITHREADS PERL_IMPLICIT_CONTEXT PERL_IMPLICIT_SYS
  Locally applied patches:
  	ActivePerl Build 623
  Built under MSWin32
  Compiled at Dec 15 2000 16:27:07
  %ENV:
    PERLDOC_CLASS="Pod::Tree::RTF"
    PERLDOC_PAGER="towrite"
  @INC:
    C:/Perl/lib
    C:/Perl/site/lib
    .



The bug has also been seen under:
 This is perl, v5.6.1 built for i386-linux
 This is perl, v5.6.1 built for sun4-solaris

But someone claiming to have bleadperl reported the bug /not/ appearing!
I don't know if that means it was properly fixed, or has merely shuffled
off elsewhere.






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