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

patch to qwell warning: Use of uninitialized value in numericeq (==) at /usr/local/lib/perl5/5.5.660/ line 38.

David Dyck
February 27, 2000 14:43
patch to qwell warning: Use of uninitialized value in numericeq (==) at /usr/local/lib/perl5/5.5.660/ line 38.
Message ID:

I tried to submit this to perlbug, but 
haven't received confirmation

Anyway, this patch matches the warning
fix that was done to

---------- Forwarded message ----------
Date: Sat, 26 Feb 2000 14:02:45 -0800
From: David Dyck <>
Subject: Use of uninitialized value in numeric eq (==) at
    /usr/local/lib/perl5/5.5.660/ line 38.  (with patch to

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

[Please enter your report here]

   == patch to follows ==

I had a script that I wrote long ago that required
when I ran it recently it gave the same errors as the
one line example

dd:jtag$ perl -w -le 'require ""; &initpwd;'
Use of uninitialized value in numeric eq (==) at /usr/local/lib/perl5/5.5.660/ line 38.

I can switch to using Cwd

dd:jtag$ perl -w -MCwd -le 'Cwd::chdir_init'
dd:jtag$ /bin/pwd

dd:jtag$ echo $PWD

but it appears that the code in needs to be patched
like was, since the stats may fail and return undefined value

--- perl5.5.660/lib/	Sun Jul 25 22:03:47 1999
+++ perl5.5.660/lib/	Sat Feb 26 13:54:46 2000
@@ -25,7 +25,7 @@
     if ($ENV{'PWD'}) {
 	local($dd,$di) = stat('.');
 	local($pd,$pi) = stat($ENV{'PWD'});
-	if ($di != $pi || $dd != $pd) {
+	if (!defined $dd or !defined $pd or $di != $pi or $dd != $pd) {
 	    chop($ENV{'PWD'} = `pwd`);
@@ -35,7 +35,7 @@
     if ($ENV{'PWD'} =~ m|(/[^/]+(/[^/]+/[^/]+))(.*)|) {
 	local($pd,$pi) = stat($2);
 	local($dd,$di) = stat($1);
-	if ($di == $pi && $dd == $pd) {
+	if (defined $pd and defined $dd and $di == $pi and $dd == $pd) {

[Please do not change anything below this line]

Site configuration information for perl v5.5.660:

Configured by dcd at Thu Feb 24 09:54:36 PST 2000.

Summary of my perl5 (revision 5.0 version 5 subversion 660) configuration:
    osname=linux, osvers=2.2.15pre10, archname=i686-linux
    uname='linux dd 2.2.15pre10 #2 thu feb 24 09:36:58 pst 2000 i686 '
    config_args='-Doptimize=-g -de'
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=undef use5005threads=undef useithreads=undef
    usesocks=undef useperlio=undef d_sfio=undef
    use64bits=undef uselargefiles=define usemultiplicity=undef
    cc='cc', optimize='-g', gccversion=
    cppflags='-DDEBUGGING -I/usr/local/include'
    ccflags ='-DDEBUGGING -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', ivsize=4, nvtype='double', nvsize=8, 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=-lgdbm -ldbm -ldb -ldl -lm -lc
    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.5.660:

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