develooper Front page | perl.perl5.porters | Postings from September 2005

[perl #37302] if ... elsif gives wrong line # for warning about undefined value

Thread Next
ludemann @ yahoo-inc . com
September 28, 2005 17:05
[perl #37302] if ... elsif gives wrong line # for warning about undefined value
Message ID:
# New Ticket Created by 
# Please include the string:  [perl #37302]
# 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]

My problem code had something like this:

  if (defined $a && $a =~ m/.../) { # line 1 <== got warning about this
  } elsif ($b =~ m/.../) { # line 3 <== but real problem was here
  } else {

This was getting an occasional, clearly bogus, warning about an
undefined variable in line 1. The actual undefined variable was in
line 3.

   (BTW, the message "Use of uninitialized value in pattern match
   (m//)" could be improved ... it's not clear whether the pattern
   contains an uninitialized value or the value that's being pattern
   matched is uninitialized.) 

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

Configured by rr at Thu Mar  7 23:10:53 PST 2002.

Summary of my perl5 (revision 5.0 version 6 subversion 1) configuration:
    osname=freebsd, osvers=4, archname=i386-freebsd
    uname='FreeBSD 4.1-YAHOO-20001028 FreeBSD 4.1-YAHOO-20001028 #0: Sat Dec  1 16:59:23 PST 2001  i386'
    hint=previous, 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='gcc', ccflags ='-fno-strict-aliasing -I/home/y/include -I/usr/local/include -march=pentiumpro -pipe',
    optimize='-g -O2',
    cppflags='-fno-strict-aliasing -I/home/y/include -I/usr/local/include -march=pentiumpro -pipe'
    ccversion='', gccversion='2.95.3 20010315 (release)', gccosandvers='freebsdelf'
    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='gcc', ldflags ='-Wl,-E  -L/home/y/lib -L/usr/local/lib'
    libpth=/usr/lib /home/y/lib /usr/local/lib
    libs=-lm -lc -lcrypt -lutil
    perllibs=-lm -lc -lcrypt -lutil
    libc=, so=so, useshrplib=true,
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='  -Wl,-R/home/y/lib/perl5/5.6.1/i386-freebsd/CORE -Wl,-R/home/y/lib -Wl,-R/usr/local/lib'
    cccdlflags='-DPIC -fpic', lddlflags='-shared  -L/home/y/lib -L/usr/local/lib'

Locally applied patches:

@INC for perl v5.6.1:

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