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

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

Thread Next
From:
perlbug-followup
Date:
February 12, 2003 07:46
Subject:
[perl #20871] POSIX::isgraph, POSIX::isprint
Message ID:
rt-20871-50953.13.34821411855@bugs6.perl.org
# New Ticket Created by  martien.verbruggen@tradingpost.com.au 
# Please include the string:  [perl #20871]
# in the subject line of all future correspondence about this issue. 
# <URL: http://rt.perl.org/rt2/Ticket/Display.html?id=20871 >


This is a bug report for perl from mgjv@verbruggen.comdyn.com.au,
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;

Solaris:
$ /opt/perl-5.8.0/bin/perl /tmp/foo.pl
27 27 27
27 26 1

Linux:
/opt/perl-5.8.0/bin/perl foo.pl       
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]
-----------------------------------------------------------------
---
Flags:
    category=library
    severity=medium
---
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:
  Platform:
    osname=linux, osvers=2.4.9-7, archname=i586-linux
    uname='linux verbruggen.comdyn.com.au 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
  Compiler:
    cc='cc', ccflags ='-fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
    optimize='-O2',
    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/libc-2.2.4.so, 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:
    /opt/perl/lib/5.6.1/i586-linux
    /opt/perl/lib/5.6.1
    /opt/perl/lib/site_perl/5.6.1/i586-linux
    /opt/perl/lib/site_perl/5.6.1
    /opt/perl/lib/site_perl/5.6.0
    /opt/perl/lib/site_perl/5.005
    /opt/perl/lib/site_perl
    .

---
Environment for perl v5.6.1:
    HOME=/home/mgjv
    LANG=en_US
    LANGUAGE (unset)
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PATH=/home/mgjv/bin:/opt/perl/bin:/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin:/sbin:/usr/sbin:/usr/java/jdk/bin:/opt/sybase/bin:/opt/ImageMagick/bin:/opt/Adobe/Acrobat405/bin:/opt/gimp/bin:/opt/BMRT/bin:/opt/schily/bin
    PERL_BADLANG (unset)
    SHELL=/bin/zsh



Thread Next


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