develooper Front page | perl.perl5.porters | Postings from March 2000

[ID 20000324.056] -x still don't work as advertised in perlfunc

Joseph N. Hall
March 24, 2000 14:46
[ID 20000324.056] -x still don't work as advertised in perlfunc
Message ID:

This is a bug report for perl from,
generated with the help of perlbug 1.28 running under perl v5.6.0.

[Please enter your report here]

       -X      A file test, where X is one of the letters listed
               below.  This unary operator takes one argument,
               either a filename or a filehandle, and tests the
               associated file to see if something is true about
               it.  If the argument is omitted, tests $_, except
               for -t, which tests STDIN.  Unless otherwise
               documented, it returns 1 for true and '' for
               false, or the undefined value if the file doesn't
               exist.  Despite the funny names, precedence is the
               same as any other named unary operator, and the
               argument may be parenthesized like any other unary
               operator.  The operator may be any of:

% perl -e 'print +(-s "xx") + (-s "yy")'
% perl -e 'print -s("xx") + -s("yy")'

(create a file 0)
% ls -l 0
-rw-rw-r--   1 joseph   wheel           5 Mar 24 15:48 0

% perl -e 'print -s("xx") + -s("yy")'

The -x operators STILL don't work like "other named unary operator[s]".
You can see that -s("xx") + -s("yy") is -s( "xx" + -s "yy" ).  I know
this has been reported at least once (by Randal?).  I have no idea whether
they're supposed to work the way they're documented or whether the
documentation's wrong, but in any even the reality and the documentation
are not congruent.


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

Configured by joseph at Thu Mar 23 23:02:23 MST 2000.

Summary of my perl5 (revision 5.0 version 6 subversion 0) configuration:
    osname=linux, osvers=2.2.12-20, archname=i586-linux-64all
    uname='linux 2.2.12-20 #1 mon sep 27 10:25:54 edt 1999 i586 unknown '
    hint=previous, useposix=true, d_sigaction=define
    usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef
    useperlio=undef d_sfio=undef uselargefiles=define 
    use64bitint=define use64bitall=define uselongdouble=define usesocks=undef
    cc='cc', optimize='-O2', gccversion=egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)
    cppflags='-fno-strict-aliasing -I/usr/local/include'
    ccflags ='-fno-strict-aliasing -I/usr/local/include'
    stdchar='char', d_stdstdio=define, usevfork=false
    intsize=4, longsize=4, ptrsize=4, doublesize=8
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
    ivtype='long long', ivsize=8, nvtype='long double', nvsize=12, Off_t='off_t', lseeksize=4
    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 -lndbm -lgdbm -ldb -ldl -lm -lc -lposix -lcrypt
    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.0:

Environment for perl v5.6.0:
    LANGUAGE (unset)
    LOGDIR (unset)
    PERL_BADLANG (unset)
    SHELL=/bin/tcsh Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About