Perl / perl5

🐪 The Perl programming language
https://dev.perl.org/perl5/
Other
1.96k stars 556 forks source link

utf8 only in vars? (perldoc utf8) #15649

Closed p5pRT closed 8 years ago

p5pRT commented 8 years ago

Migrated from rt.perl.org#129849 (status was 'rejected')

Searchable as RT129849$

p5pRT commented 8 years ago

From perl-diddler@tlinx.org

Created by perl-diddler@tlinx.org

In the file lib/utf8.pm\, it says\, under BUGS​:

  One can have Unicode in identifier names\, but not in package/class or   subroutine names. While some limited functionality towards this does   exist as of Perl 5.8.0\, that is more accidental than designed; use of   Unicode for the said purposes is unsupported. ---

Hasn't perl's unicode support come a bit farther than what was provided in 5.8.0? I was under the impression that any "valid-for-class" UTF-8 characters were available for use anywhere in a source that had a 'use utf8' in its "header"?

I've been using it it in functions and variable names for years now (though haven't tried it with classes/packages\, I'd be surprised if they didn't handle unicode as well).

Please tell me this is an outdated "doco" (cf. typo").

Perl Info ``` Flags: category=docs severity=high Site configuration information for perl 5.22.0: Configured by perl-diddler at Sun Sep 13 17:00:58 PDT 2015. Summary of my perl5 (revision 5 version 22 subversion 0) configuration: Platform: osname=linux, osvers=4.1.0-isht-van, archname=x86_64-linux uname='linux ishtar 4.1.0-isht-van #2 smp preempt tue jun 23 07:52:09 pdt 2015 x86_64 x86_64 x86_64 gnulinux ' config_args='-Duse64bitall -Dprefix=/home/tools/perl/perl-5.22.0/usr -des -Dcc=gcc' hint=recommended, useposix=true, d_sigaction=define useithreads=undef, usemultiplicity=undef use64bitint=define, use64bitall=define, uselongdouble=undef usemymalloc=n, bincompat5005=undef Compiler: cc='gcc', ccflags ='-fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2', optimize='-O2', cppflags='-fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong' ccversion='', gccversion='4.9.0', gccosandvers='' intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678, doublekind=3 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16, longdblkind=3 ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8 alignbytes=8, prototype=define Linker and Libraries: ld='gcc', ldflags =' -fstack-protector-strong' libpth=/usr/lib64/gcc/x86_64-suse-linux/4.9/include-fixed /usr/lib64/gcc/x86_64-suse-linux/4.9/../../../../x86_64-suse-linux/lib /usr/lib /lib/../lib64 /usr/lib/../lib64 /lib /lib64 /usr/lib64 libs=-lpthread -lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc -lgdbm_compat perllibs=-lpthread -lnsl -ldl -lm -lcrypt -lutil -lc libc=libc-2.19.so, so=so, useshrplib=false, libperl=libperl.a gnulibc_version='2.19' Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E' cccdlflags='-fPIC', lddlflags='-shared -O2 -fstack-protector-strong' @INC for perl 5.22.0: /home/tools/perl/perl-5.22.0/usr/lib/site_perl/5.22.0/x86_64-linux /home/tools/perl/perl-5.22.0/usr/lib/site_perl/5.22.0 /home/tools/perl/perl-5.22.0/usr/lib/5.22.0/x86_64-linux /home/tools/perl/perl-5.22.0/usr/lib/5.22.0 . Environment for perl 5.22.0: HOME=/home/perl-diddler LANG (unset) LANGUAGE (unset) LC_COLLATE=C LC_CTYPE=en_US.UTF-8 LC_MESSAGES=C LC_MONETARY=C LC_NUMERIC=C LC_TIME=C LD_LIBRARY_PATH (unset) LOGDIR (unset) PATH=/home/tools/perl/perl-5.22/utils:/home/tools/perl/perl-5.22:/home/tools/perl/perl-5.22/bin:.:/home/perl-diddler/bin::/usr/bin:/bin:/usr/sbin:/sbin:/opt/kde3/bin:/usr/local/bin:/etc/local/func_lib PERL_BADLANG (unset) SHELL=/bin/bash ```
p5pRT commented 8 years ago

From @jkeenan

On Mon Oct 10 13​:43​:36 2016\, LAWalsh wrote​:

This is a bug report for perl from perl-diddler@​tlinx.org\, generated with the help of perlbug 1.40 running under perl 5.22.0.

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

In the file lib/utf8.pm\, it says\, under BUGS​:

One can have Unicode in identifier names\, but not in package/class or subroutine names. While some limited functionality towards this does exist as of Perl 5.8.0\, that is more accidental than designed; use of Unicode for the said purposes is unsupported. ---

Hasn't perl's unicode support come a bit farther than what was provided in 5.8.0? I was under the impression that any "valid-for- class" UTF-8 characters were available for use anywhere in a source that had a 'use utf8' in its "header"?

I've been using it it in functions and variable names for years now (though haven't tried it with classes/packages\, I'd be surprised if they didn't handle unicode as well).

Please tell me this is an outdated "doco" (cf. typo").

The documentation was changed between 5.22 and 5.24. Here is the BUGS section of lib/utf8.pm in perl-5.24.0​:

##### BUGS Some filesystems may not support UTF-8 file names\, or they may be supported incompatibly with Perl. Therefore UTF-8 names that are visible to the filesystem\, such as module names may not work. #####

Thank you very much.

-- James E Keenan (jkeenan@​cpan.org)

p5pRT commented 8 years ago

The RT System itself - Status changed from 'new' to 'open'

p5pRT commented 8 years ago

@jkeenan - Status changed from 'open' to 'rejected'