develooper Front page | perl.perl5.porters | Postings from February 2003

[perl #20871] POSIX::isgraph, POSIX::isprint

Thread Next
February 12, 2003 07:46
[perl #20871] POSIX::isgraph, POSIX::isprint
Message ID:
# New Ticket Created by 
# Please include the string:  [perl #20871]
# 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.33 running under perl v5.6.1.

[Please enter your report here]

POSIX::isprint, POSIX::isgraph and POSIX::isspace are not working as
advertised, and are working differently from the character classes
[[::print:]], [[:graph:]] and [[:space:]]. The following test program
displays the wrong result on both Solaris 8 and linux (redhat 8):

require POSIX; 

my @a1 = grep POSIX::isprint($_), map chr($_), 0x20, 0x41 .. 0x5a;
my @a2 = grep POSIX::isgraph($_), map chr($_), 0x20, 0x41 .. 0x5a;
my @a3 = grep POSIX::isspace($_), map chr($_), 0x20, 0x41 .. 0x5a;

printf "%d %d %d\n", scalar @a1, scalar @a2, scalar @a3;

my @a1 = grep /^[[:print:]]$/, map chr($_), 0x20, 0x41 .. 0x5a;
my @a2 = grep /^[[:graph:]]$/, map chr($_), 0x20, 0x41 .. 0x5a;
my @a3 = grep /^[[:space:]]$/, map chr($_), 0x20, 0x41 .. 0x5a;

printf "%d %d %d\n", scalar @a1, scalar @a2, scalar @a3;

$ /opt/perl-5.8.0/bin/perl /tmp/
27 27 27
27 26 1

27 27 27
27 26 1

Under 5.6.1 under linux this works fine, as expected (I don't have
5.6.1 on solaris available at the moment) On 5.005_03 on either
platform the [[:foo:]] character classes don't work, as we all know,
but the POSIX functions work correctly.

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

Configured by mgjv at Tue Oct 30 13:13:19 EST 2001.

Summary of my perl5 (revision 5.0 version 6 subversion 1) configuration:
    osname=linux, osvers=2.4.9-7, archname=i586-linux
    uname='linux 2.4.9-7 #1 thu oct 18 13:42:17 edt 2001 i586 unknown '
    config_args='-Dprefix=/opt/perl -des'
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef
    useperlio=undef d_sfio=undef uselargefiles=define usesocks=undef
    use64bitint=undef use64bitall=undef uselongdouble=undef
    cc='cc', ccflags ='-fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
    cppflags='-fno-strict-aliasing -I/usr/local/include'
    ccversion='', gccversion='2.96 20000731 (Red Hat Linux 7.1 2.96-98)', gccosandvers=''
    intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
    ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
    alignbytes=4, usemymalloc=n, prototype=define
  Linker and Libraries:
    ld='cc', ldflags =' -L/usr/local/lib'
    libpth=/usr/local/lib /lib /usr/lib
    libs=-lnsl -lgdbm -ldl -lm -lc -lcrypt -lutil
    perllibs=-lnsl -ldl -lm -lc -lcrypt -lutil
    libc=/lib/, so=so, useshrplib=false, libperl=libperl.a
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic'
    cccdlflags='-fpic', lddlflags='-shared -L/usr/local/lib'

Locally applied patches:

@INC for perl v5.6.1:

Environment for perl v5.6.1:
    LANGUAGE (unset)
    LD_LIBRARY_PATH (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