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

[perl #81016] Document ord("")

Thread Next
Zsban Ambrus
December 20, 2010 08:57
[perl #81016] Document ord("")
Message ID:
# New Ticket Created by  Zsban Ambrus 
# Please include the string:  [perl #81016]
# in the subject line of all future correspondence about this issue. 
# <URL: >

This is a bug report for perl from,
generated with the help of perlbug 1.39 running under perl 5.12.2.

[Please describe your issue here]

The following patch clarifies what ord("") does in pod/perlfunc.pod.

>From the current documentation, it's not documented what it does, and one
could guess several different things: returns zero, returns undef, returns
zero with a warning, returns undef with a warning, dies.  (There's precedent
for dying: some BASIC implementations give an error if you ask for ASC("")
-- here ASC is their equivalent of our ord function.)

--- perl-5.13.7/pod/perlfunc.pod	2010-12-20 13:06:48.000000000 +0100
+++ perl-5.13.7/pod/perlfunc.pod	2010-12-20 13:08:38.000000000 +0100
@@ -3600,10 +3600,10 @@

 =item ord

 Returns the numeric (the native 8-bit encoding, like ASCII or EBCDIC,
-or Unicode) value of the first character of EXPR.  If EXPR is omitted,
-uses C<$_>.
+or Unicode) value of the first character of EXPR.  If EXPR is an empty
+string, returns 0.  If EXPR is omitted, uses C<$_>.

 For the reverse, see L</chr>.
 See L<perlunicode> for more about Unicode.

[Please do not change anything below this line]
Site configuration information for perl 5.12.2:

Configured by ambrus at Sat Oct  9 20:40:07 CEST 2010.

Summary of my perl5 (revision 5 version 12 subversion 2) configuration:

    osname=linux, osvers=, archname=x86_64-linux
    uname='linux king #1 smp sat jul 10 18:21:56 cest 2010
x86_64 gnulinux '
    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
    cc='cc', ccflags ='-fno-strict-aliasing -pipe -fstack-protector
-I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
    cppflags='-fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include'
    ccversion='', gccversion='4.5.1', 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',
    alignbytes=8, prototype=define
  Linker and Libraries:
    ld='cc', ldflags =' -fstack-protector -L/usr/local/lib'
    libpth=/usr/local/lib /lib /usr/lib /lib64 /usr/lib64 /usr/local/lib64
    libs=-lnsl -ldl -lm -lcrypt -lutil -lc
    perllibs=-lnsl -ldl -lm -lcrypt -lutil -lc
    libc=/lib/, so=so, useshrplib=false, libperl=libperl.a
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E'
    cccdlflags='-fPIC', lddlflags='-shared -O2 -L/usr/local/lib

Locally applied patches:

@INC for perl 5.12.2:

Environment for perl 5.12.2:
    LANG (unset)
    LANGUAGE (unset)
    LOGDIR (unset)
    PERL_BADLANG (unset)

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About