Front page | perl.perl5.porters |
Postings from July 2011
[perl #95010] perl constant's don't work w/unicode letters
Thread Previous
From:
Linda Walsh
Date:
July 17, 2011 18:48
Subject:
[perl #95010] perl constant's don't work w/unicode letters
Message ID:
rt-3.6.HEAD-30268-1310953688-1562.95010-75-0@perl.org
# New Ticket Created by Linda Walsh
# Please include the string: [perl #95010]
# in the subject line of all future correspondence about this issue.
# <URL: https://rt.perl.org:443/rt3/Ticket/Display.html?id=95010 >
This is a bug report for perl from perl-diddler@tlinx.org,
generated with the help of perlbug 1.39 running under perl 5.12.3.
-----------------------------------------------------------------
[Please describe your issue here]
test prog:
--------------
#!/usr/bin/perl -- -w
use utf8;
binmode STDOUT, 'encoding(UTF-8)';
binmode STDERR, 'encoding(UTF-8)';
use Readonly;
Readonly $π => 4.*atan2(1,1);
use constant π => 4.*atan2(1,1);
use constant pi => 4.*atan2(1,1);
binmode STDOUT, 'encoding(UTF-8)';
binmode STDERR, 'encoding(UTF-8)';
printf "pi=%f and \$π=%f, but π=%f\n", pi, $π, π;
--------------
prints:
pi=3.141593 and $π=3.141593, but π=0.000000
(i.e. last # is wrong).
if you remove the "--", you see:
Argument "\x{3c0}" isn't numeric in printf at /tmp/test.pl line 16.
pi=3.141593 and $π=3.141593, but π=0.000000
I thought I remember reporting this about constant some
time back (almost 2 years ago... I found a reference to finding
the problem in bug #69032, (Sep09), but couldn't find any bug
on it.
[Please do not change anything below this line]
-----------------------------------------------------------------
---
Flags:
category=library
severity=high
module=constant
---
This perlbug was built using Perl 5.12.3 - Fri May 6 13:31:41 UTC 2011
It is being executed now by Perl 5.12.3 - Fri May 6 13:26:30 UTC 2011.
Site configuration information for perl 5.12.3:
Configured by abuild at Fri May 6 13:26:30 UTC 2011.
Summary of my perl5 (revision 5 version 12 subversion 3) configuration:
Platform:
osname=linux, osvers=2.6.36, archname=x86_64-linux-thread-multi
uname='linux build33 2.6.36 #1 smp 2011-02-21 10:34:10 +0100 x86_64 x86_64 x86_64 gnulinux '
config_args='-ds -e -Dprefix=/usr -Dvendorprefix=/usr -Dinstallusrbinperl -Dusethreads -Di_db -Di_dbm -Di_ndbm -Di_gdbm -Duseshrplib=true -Doptimize=-fmessage-length=0 -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -g -Wall -pipe -Accflags=-DPERL_USE_SAFE_PUTENV'
hint=recommended, useposix=true, d_sigaction=define
useithreads=define, usemultiplicity=define
useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
use64bitint=define, use64bitall=define, uselongdouble=undef
usemymalloc=n, bincompat5005=undef
Compiler:
cc='cc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -DPERL_USE_SAFE_PUTENV -DDEBUGGING -fno-strict-aliasing -pipe -fstack-protector -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
optimize='-fmessage-length=0 -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -g -Wall -pipe',
cppflags='-D_REENTRANT -D_GNU_SOURCE -DPERL_USE_SAFE_PUTENV -DDEBUGGING -fno-strict-aliasing -pipe -fstack-protector'
ccversion='', gccversion='4.5.1 20101208 [gcc-4_5-branch revision 167585]', 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 =' -L/usr/local/lib64 -fstack-protector'
libpth=/lib64 /usr/lib64 /usr/local/lib64
libs=-lm -ldl -lcrypt -lpthread
perllibs=-lm -ldl -lcrypt -lpthread
libc=/lib64/libc-2.11.3.so, so=so, useshrplib=true, libperl=libperl.so
gnulibc_version='2.11.3'
Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E -Wl,-rpath,/usr/lib/perl5/5.12.3/x86_64-linux-thread-multi/CORE'
cccdlflags='-fPIC', lddlflags='-shared -L/usr/local/lib64 -fstack-protector'
Locally applied patches:
---
@INC for perl 5.12.3:
/usr/lib/perl5/site_perl/5.12.3/x86_64-linux-thread-multi
/usr/lib/perl5/site_perl/5.12.3
/usr/lib/perl5/vendor_perl/5.12.3/x86_64-linux-thread-multi
/usr/lib/perl5/vendor_perl/5.12.3
/usr/lib/perl5/5.12.3/x86_64-linux-thread-multi
/usr/lib/perl5/5.12.3
.
---
Environment for perl 5.12.3:
HOME=/home/law
LANG=en_US.UTF-8
LANGUAGE (unset)
LC_CTYPE=en_US.UTF-8
LD_LIBRARY_PATH (unset)
LOGDIR (unset)
PATH=.:/sbin:/usr/local/sbin:/opt/lsb/bin:/home/law/bin:/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/usr/games:/opt/kde3/bin:/usr/lib/mit/bin:/usr/lib/mit/sbin:/usr/lib/qt3/bin:/usr/sbin
PERL_BADLANG (unset)
SHELL=/bin/bash
Thread Previous