develooper Front page | perl.perl5.porters | Postings from January 2001

[ID 20010122.052] weird behavoir of dbmopen+local

From:
pb
Date:
January 22, 2001 16:36
Subject:
[ID 20010122.052] weird behavoir of dbmopen+local
Message ID:
200101192116.f0JLG2M67056@fasterix.frmug.org

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


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

The following code does not seem to work as expected on Perl 5:
calling clobber() empties the hash. It works as expected on Perl 4.

sub clobber {
    local (%db) = ();
}

local (%db) = ();
dbmopen(%db,'test',0666);

$db{'abc'} = "1";
$db{'def'} = "2";

print "avant clobber\n";
foreach (keys(%db)) { print "key=$_\n"; }
&clobber();
print "apr├Ęs clobber\n";
foreach (keys(%db)) { print "key=$_\n"; }

dbmclose(%db);

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

Configured by markm at Mon Apr 24 11:11:27 SAST 2000.

Summary of my perl5 (revision 5.0 version 6 subversion 0) configuration:
  Platform:
    osname=freebsd, osvers=5.0-current, archname=i386-freebsd
    uname='freebsd freefall.FreeBSD.org 5.0-current freebsd 5.0-current #0: $Date$ '
    config_args='-Dprefix=/usr/local -Darchlib=/usr/libdata/perl/5.6.0/mach -Dprivlib=/usr/libdata/perl/5.6.0 -Dsitearch=/usr/local/lib/perl5/site_perl/5.6.0/mach -Dsitelib=/usr/local/lib/perl5/site_perl/5.6.0 -Dinstallsitearch=/usr/local/lib/perl5/site_perl/5.6.0/mach -Dinstallsitelib=/usr/local/lib/perl5/site_perl/5.6.0 -Dinstallbin=/usr/local/bin -Dinstallsitebin=/usr/local/bin -Dinstallscript=/usr/local/bin -Dman1dir=/usr/local/man/man1 -Dman3dir=/usr/local/lib/perl5/5.6.0/man/man3 -Duseshrplib=true -Ulocincpth= -Uloclibpth= -Dpager=/usr/bin/more -des'
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef
    useperlio=undef d_sfio=undef uselargefiles=define 
    use64bitint=undef use64bitall=undef uselongdouble=undef usesocks=undef
  Compiler:
    cc='cc', optimize='undef', gccversion=2.95.2 19991024 (release)
    cppflags='-fno-strict-aliasing'
    ccflags ='-fno-strict-aliasing'
    stdchar='char', d_stdstdio=undef, usevfork=true
    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=8
    alignbytes=4, usemymalloc=n, prototype=define
  Linker and Libraries:
    ld='cc', ldflags ='-Wl,-E -lperl -lm '
    libpth=/usr/lib
    libs=-lm -lc -lcrypt
    libc=, so=so, useshrplib=true, libperl=libperl.so.4
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' -Wl,-R/usr/lib'
    cccdlflags='-DPIC -fpic', lddlflags='-Wl,-E -shared -lperl -lm '

Locally applied patches:
    SUIDMAIL - fixes for suidperl security

---
@INC for perl v5.6.0:
    /usr/libdata/perl/5.6.0/mach
    /usr/libdata/perl/5.6.0
    /usr/local/lib/perl5/site_perl/5.6.0/mach
    /usr/local/lib/perl5/site_perl/5.6.0
    /usr/local/lib/perl5/site_perl/5.6.0
    .

---
Environment for perl v5.6.0:
    HOME=/users/pb
    LANG=fr_FR.ISO8859-1
    LANGUAGE (unset)
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PATH=/sbin:/usr/sbin:/usr/bin:/bin:/usr/games:/usr/local/bin:/usr/local/bin/urt:/usr/X11R6/bin:/usr/local/bin:/usr/local/jdk/bin:/users/pb/bin:.:/usr/libexec/uucp
    PERL_BADLANG (unset)
    SHELL=/usr/local/bin/zsh




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