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

[ID 20010801.041] tied hash in scalar context returns 0

Thread Next
From:
Autrijus Tang
Date:
August 1, 2001 13:51
Subject:
[ID 20010801.041] tied hash in scalar context returns 0
Message ID:
200108012051.f71Kpvg79981@geb.elixus.org
This is a bug report for perl from autrijus@autrijus.org,
generated with the help of perlbug 1.32 running under perl v5.6.1.


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

tied hash in scalar context returns 0. this is not very consistent
with the if(%h) idiom; if it's not easy to fix, at least some
pod patch should be available.

#!/usr/bin/perl
$a->{foo} = 1;
print %$a ? "ok 1\n" : "not ok 1\n";

use DB_File;
tie %$b => 'DB_File', '/tmp/test';

$b->{foo} = 1;
print %$b ? "ok 2\n" : "not ok 2\n";


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

Configured by autrijus at Tue Apr 10 06:32:11 CST 2001.

Summary of my perl5 (revision 5.0 version 6 subversion 1) configuration:
  Platform:
    osname=freebsd, osvers=4.2-stable, archname=i386-freebsd
    uname='freebsd geb.elixus.org 4.2-stable freebsd 4.2-stable #1: sat mar 3 00:35:52 cst 2001 root@geb.elixus.org:usrsrcsyscompilegeb i386 '
    config_args=''
    hint=recommended, 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
  Compiler:
    cc='cc', ccflags ='-fno-strict-aliasing -I/usr/local/include',
    optimize='-O',
    cppflags='-fno-strict-aliasing -I/usr/local/include'
    ccversion='', gccversion='2.95.2 19991024 (release)', 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, usemymalloc=n, prototype=define
  Linker and Libraries:
    ld='cc', ldflags ='-Wl,-E  -L/usr/local/lib'
    libpth=/usr/lib /usr/local/lib
    libs=-ldb -lm -lc -lcrypt -lutil
    perllibs=-lm -lc -lcrypt -lutil
    libc=, so=so, useshrplib=false, libperl=libperl.a
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' '
    cccdlflags='-DPIC -fpic', lddlflags='-shared  -L/usr/local/lib'

Locally applied patches:
    

---
@INC for perl v5.6.1:
    /usr/local/lib/perl5/5.6.1/i386-freebsd
    /usr/local/lib/perl5/5.6.1
    /usr/local/lib/perl5/site_perl/5.6.1/i386-freebsd
    /usr/local/lib/perl5/site_perl/5.6.1
    /usr/local/lib/perl5/site_perl
    .

---
Environment for perl v5.6.1:
    HOME=/home/staff/autrijus
    LANG (unset)
    LANGUAGE (unset)
    LC_CTYPE=en_US.ISO_8859-1
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/games:/usr/local/bin:/usr/X11R6/bin:/home/staff/autrijus/bin
    PERL_BADLANG (unset)
    SHELL=/bin/tcsh


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