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

[perl #22033] undef inconsistencies

Thread Next
From:
perlbug-followup
Date:
April 24, 2003 15:04
Subject:
[perl #22033] undef inconsistencies
Message ID:
rt-22033-55862.11.0681270666369@bugs6.perl.org
# New Ticket Created by  tassilo.parseval@post.rwth-aachen.de 
# Please include the string:  [perl #22033]
# in the subject line of all future correspondence about this issue. 
# <URL: http://rt.perl.org/rt2/Ticket/Display.html?id=22033 >



This is a bug report for perl from tassilo.parseval@post.rwth-aachen.de,
generated with the help of perlbug 1.34 running under perl v5.8.0.


-----------------------------------------------------------------
[Please enter your report here]

The following cases seem inconsistent to me:

1)
ethan@ethan:~$ perl
undef <=> undef
^D
syntax error at - line 1, next token ???
Execution of - aborted due to compilation errors.

2)
ethan@ethan:~$ perl
undef <=> undef;
^D
syntax error at - line 1, near "<=> undef"
Execution of - aborted due to compilation errors.

3)
ethan@ethan:~$ perl
1 + undef
^D

4)
ethan@ethan:~$ perl
undef + undef
^D
Warning: Use of "undef" without parens is ambiguous at - line 1.
Modification of a read-only value attempted at - line 1.

Looks as though the parser gets confused and drops the operator between two
undefs:

ethan@ethan:~$ perl -MO=Deparse
$a = undef + undef;
^D
Warning: Use of "undef" without parens is ambiguous at - line 1.
$a = undef undef;
- syntax OK


[Please do not change anything below this line]
-----------------------------------------------------------------
---
Flags:
    category=core
    severity=low
---
Site configuration information for perl v5.8.0:

Configured by root at Tue Feb 25 16:06:57 Local time zone must be set--see zic manual page 2003.

Summary of my perl5 (revision 5.0 version 8 subversion 0) configuration:
  Platform:
    osname=linux, osvers=2.4.20, archname=i686-linux
    uname='linux ethan 2.4.20 #2 mon dec 2 14:26:23 cet 2002 i686 unknown '
    config_args='-ds -e -Dprefix=/usr -Dccflags= -O3 -march=athlon'
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef
    useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
    use64bitint=undef use64bitall=undef uselongdouble=undef
    usemymalloc=n, bincompat5005=undef
  Compiler:
    cc='cc', ccflags ='-O3 -march=athlon -fno-strict-aliasing -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
    optimize='-O2',
    cppflags='-O3 -march=athlon -fno-strict-aliasing'
    ccversion='', gccversion='3.2', 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, prototype=define
  Linker and Libraries:
    ld='cc', ldflags =' -L/usr/local/lib'
    libpth=/usr/local/lib /lib /usr/lib
    libs=-lnsl -ldl -lm -lc -lcrypt -lutil
    perllibs=-lnsl -ldl -lm -lc -lcrypt -lutil
    libc=/lib/libc-2.2.5.so, so=so, useshrplib=false, libperl=libperl.a
    gnulibc_version='2.2.5'
  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.8.0:
    /usr/lib/perl5/5.8.0/i686-linux
    /usr/lib/perl5/5.8.0
    /usr/lib/perl5/site_perl/5.8.0/i686-linux
    /usr/lib/perl5/site_perl/5.8.0
    /usr/lib/perl5/site_perl
    .

---
Environment for perl v5.8.0:
    HOME=/home/ethan
    LANG=C
    LANGUAGE (unset)
    LC_CTYPE=de_DE@euro
    LD_LIBRARY_PATH=:/usr/local/j2sdk1.4.0/jre/lib/i386:/usr/local/pwlib/lib
    LOGDIR (unset)
    PATH=/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/usr/games:/usr/local/j2re1.4.1/bin
    PERLDOC_PAGER=/bin/less -isR
    PERL_BADLANG (unset)
    SHELL=/bin/bash



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