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

[perl #131166] Error in documentation on "perldata"

Thread Next
From:
James E Keenan via RT
Date:
April 18, 2017 18:57
Subject:
[perl #131166] Error in documentation on "perldata"
Message ID:
rt-4.0.24-19962-1492541816-1357.131166-15-0@perl.org
On Mon, 17 Apr 2017 12:17:45 GMT, wolf-dietrich_moeller@t-online.de wrote:
> This is a bug report for perl from wolf-dietrich_moeller@t-online.de,
> generated with the help of perlbug 1.40 running under perl 5.24.1.
> 
> 
> -----------------------------------------------------------------
> [Please describe your issue here]
> The documentation "perldata" reads in the section on "Scalar values" the
> following:
> "If you evaluate a hash in scalar context, it returns false if the hash is
> empty. ..."
> This statement not completely true.
> - It is true if evaluated in Boolean context, e.g. in "if ( %hash )".

$ perl -wE '%hash = (); if (%hash) { say "Demonstrated"; } else { say "Not demonstrated"; }'
Not demonstrated

> - But if used in scalar context expecting a string (e.g. 'n='.%hash), it
> returns "0",
>   and not the empty string, which would be expected for a result = "false".
> 
> So the sentence cited above should read:
> "If you evaluate a hash in scalar context, it returns 0 if the hash is
> empty. ..."
> 
> [Please do not change anything below this line]
> -----------------------------------------------------------------
> ---
> Flags:
>     category=docs
>     severity=low
> ---
> Site configuration information for perl 5.24.1:
> 
> Configured by strawberry-perl at Sun Jan 15 20:30:58 2017.
> 
> Summary of my perl5 (revision 5 version 24 subversion 1) configuration:
>    
>   Platform:
>     osname=MSWin32, osvers=6.3, archname=MSWin32-x86-multi-thread-64int
>     uname='Win32 strawberry-perl 5.24.1.1 #1 Sun Jan 15 20:28:53 2017 i386'
>     config_args='undef'
>     hint=recommended, useposix=true, d_sigaction=undef
>     useithreads=define, usemultiplicity=define
>     use64bitint=define, use64bitall=undef, uselongdouble=undef
>     usemymalloc=n, bincompat5005=undef
>   Compiler:
>     cc='gcc', ccflags =' -s -O2 -DWIN32  -DPERL_TEXTMODE_SCRIPTS
> -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -fwrapv -fno-strict-aliasing
> -mms-bitfields',
>     optimize='-s -O2',
>     cppflags='-DWIN32'
>     ccversion='', gccversion='4.9.2', gccosandvers=''
>     intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=12345678,
> doublekind=3
>     d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12,
> longdblkind=3
>     ivtype='long long', ivsize=8, nvtype='double', nvsize=8, Off_t='long
> long', lseeksize=8
>     alignbytes=8, prototype=define
>   Linker and Libraries:
>     ld='g++', ldflags ='-s -L"C:\Perl\perl\lib\CORE" -L"C:\Perl\c\lib"'
>     libpth=C:\Perl\c\lib C:\Perl\c\i686-w64-mingw32\lib
> C:\Perl\c\lib\gcc\i686-w64-mingw32\4.9.2
>     libs=-lmoldname -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32
> -ladvapi32 -lshell32 -lole32 -loleaut32 -lnetapi32 -luuid -lws2_32 -lmpr
> -lwinmm -lversion -lodbc32 -lodbccp32 -lcomctl32
>     perllibs=-lmoldname -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32
> -ladvapi32 -lshell32 -lole32 -loleaut32 -lnetapi32 -luuid -lws2_32 -lmpr
> -lwinmm -lversion -lodbc32 -lodbccp32 -lcomctl32
>     libc=, so=dll, useshrplib=true, libperl=libperl524.a
>     gnulibc_version=''
>   Dynamic Linking:
>     dlsrc=dl_win32.xs, dlext=xs.dll, d_dlsymun=undef, ccdlflags=' '
>     cccdlflags=' ', lddlflags='-mdll -s -L"C:\Perl\perl\lib\CORE"
> -L"C:\Perl\c\lib"'
> 
> 
> ---
> @INC for perl 5.24.1:
>     C:/Perl/perl/site/lib
>     C:/Perl/perl/vendor/lib
>     C:/Perl/perl/lib
> 
> ---
> Environment for perl 5.24.1:
>     HOME (unset)
>     LANG (unset)
>     LANGUAGE (unset)
>     LD_LIBRARY_PATH (unset)
>     LOGDIR (unset)
>     PATH=C:\Documents and Settings\All Users\Application
> Data\Oracle\Java\javapath;C:\Program Files\Perl\site\bin;C:\Program
> Files\Perl\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Pr
> ogram Files\Windows
> Imaging\;C:\WINDOWS\system32\WindowsPowerShell\v1.0;C:\Bin;C:\Program
> Files\QuickTime
> Alternative\QTSystem;C:\Perl\c\bin;C:\Perl\perl\site\bin;C:\Perl\perl\bin
>     PERL_BADLANG (unset)
>     SHELL (unset)


-- 
James E Keenan (jkeenan@cpan.org)

---
via perlbug:  queue: perl5 status: new
https://rt.perl.org/Ticket/Display.html?id=131166

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