develooper Front page | perl.perl5.porters | Postings from June 2013

[perl #118451] Bareword hash key rejected when hash is a subroutine result and -> omitted

Thread Previous | Thread Next
From:
James E Keenan via RT
Date:
June 12, 2013 23:26
Subject:
[perl #118451] Bareword hash key rejected when hash is a subroutine result and -> omitted
Message ID:
rt-3.6.HEAD-2552-1371079598-181.118451-15-0@perl.org
On Wed Jun 12 09:49:51 2013, rob.dixon@gmx.com wrote:
> 
> This is a bug report for perl from rob.dixon@gmx.com,
> generated with the help of perlbug 1.39 running under perl 5.16.2.
> 
> use strict;
> use warnings;
> use 5.016;
> 

Problem confirmed, but it should be noted that 'use 5.016;' can be
commented out without preventing the problem from manifesting.


> my $hashsub = sub {
>   { key => 'val' }
> };
> 
> # These work fine
> 
> print $hashsub->()->{key}, "\n";
> print $hashsub->(){'key'}, "\n";
> 
> # But this throws `Bareword "key" not allowed while "strict subs" in
>    use`
> 
> print $hashsub->(){key}, "\n";
> 
> 
> ---
> Flags:
>     category=core
>     severity=medium
> ---
> Site configuration information for perl 5.16.2:
> 
> Configured by strawberry-perl at Fri Nov  2 00:34:53 2012.
> 
> Summary of my perl5 (revision 5 version 16 subversion 2)
>    configuration:
>      Platform:
>     osname=MSWin32, osvers=4.0, archname=MSWin32-x86-multi-thread
>     uname='Win32 strawberry-perl 5.16.2.1 #1 Fri Nov  2 00:33:54 2012
>    i386'
>     config_args='undef'
>     hint=recommended, useposix=true, d_sigaction=undef
>     useithreads=define, usemultiplicity=define
>     useperlio=define, d_sfio=undef, uselargefiles=define,
>    usesocks=undef
>     use64bitint=undef, use64bitall=undef, uselongdouble=undef
>     usemymalloc=n, bincompat5005=undef
>   Compiler:
>     cc='gcc', ccflags =' -s -O2 -DWIN32  -DPERL_TEXTMODE_SCRIPTS
>    -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -fno-strict-aliasing
>    -mms-bitfields',
>     optimize='-s -O2',
>     cppflags='-DWIN32'
>     ccversion='', gccversion='4.6.3', gccosandvers=''
>     intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
>     d_longlong=undef, longlongsize=8, d_longdbl=define, longdblsize=12
>     ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='long
>    long', lseeksize=8
>     alignbytes=8, prototype=define
>   Linker and Libraries:
>     ld='g++', ldflags ='-s -L"C:\strawberry\perl\lib\CORE"
>    -L"C:\strawberry\c\lib"'
>     libpth=C:\strawberry\c\lib C:\strawberry\c\i686-w64-mingw32\lib
>     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=libperl516.a
>     gnulibc_version=''
>   Dynamic Linking:
>     dlsrc=dl_win32.xs, dlext=dll, d_dlsymun=undef, ccdlflags=' '
>     cccdlflags=' ', lddlflags='-mdll -s
>    -L"C:\strawberry\perl\lib\CORE" -L"C:\strawberry\c\lib"'
> 
> Locally applied patches:
> 
> ---
> @INC for perl 5.16.2:
>     C:/strawberry/perl/site/lib/MSWin32-x86-multi-thread
>     C:/strawberry/perl/site/lib
>     C:/strawberry/perl/vendor/lib
>     C:/strawberry/perl/lib
>     .
> 
> ---
> Environment for perl 5.16.2:
>     HOME (unset)
>     LANG (unset)
>     LANGUAGE (unset)
>     LD_LIBRARY_PATH (unset)
>     LOGDIR (unset)
>     PATH=C:\Program Files (x86)\ImageMagick-6.8.3-Q16;C:\Program
>    Files\ImageMagick-6.8.3-Q16;C:\Program Files (x86)\NVIDIA
>    Corporation\PhysX\Common;C:\Program Files (x86)\PC Connectivity
>    Solution\;C:\Program Files\Common Files\Microsoft Shared\Windows
>    Live;C:\Program Files
>   
(x86)\PHP\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program
>    Files\jEdit;C:\usr\local\ppt\bin;C:\Program Files
>    (x86)\GnuWin32\bin;C:\Program Files (x86)\Smart
>    Projects\IsoBuster;C:\Program Files (x86)\Oracle\Berkeley DB 11gR2
>    5.3.15\bin;C:\Program Files (x86)\Git\cmd;C:\Program Files
>    (x86)\Calibre2\;C:\Program Files (x86)\Bazaar;C:\Program Files
>    (x86)\Lua\5.1;C:\Program Files
>   
(x86)\Lua\5.1\clibs;C:\strawberry\c\bin;C:\strawberry\perl\site\bin;C:\strawberry\perl\bin;C:\Program
>    Files\TortoiseSVN\bin;C:\MediaInfoCLI;C:\Program Files
>    (x86)\MKVToolNix;C:\Program Files\WinRAR;C:\Program Files\Common
>    Files\Microsoft Shared\Windows Live;C:\Program Files (x86)\Co
> mmon Files\Hackety Hack\0.r1529\..;C:\Program Files (x86)\IDM Computer
>    Solutions\UltraCompare\;C:\ffmpeg\bin;C:\Program Files
>    (x86)\Serviio\lib;C:\Program Files (x86)\Microsoft Visual Studio
>    10.0\VC\bin\x86_amd64;C:\Program Files (x86)\Microsoft Visual
>    Studio
>   
10.0\VC\bin\amd64;C:\SWIG;C:\MinGW\bin;C:\MinGW\MSYS\1.0\bin;C:\Python27;C:\Curl;C:\pkg-
>    config\bin;C:\glib\bin;C:\gettext-runtime\bin;C:\Program Files
>    (x86)\IDM Computer Solutions\UltraEdit\;C:\LuaRocks\2.0;C:\Program
>    Files (x86)\Android\android-sdk\platform-
>    tools;C:\Ruby193\bin;C:\Ruby193.DevKit\bin;C:\Program Files
>    (x86)\Nmap;C:\Program Files (x86)\EaseUS\Todo Backup\bin\x64\
>     PERL_BADLANG (unset)
>     SHELL (unset)
> ---
> Flags:
>     category=core
>     severity=medium
> ---
> Site configuration information for perl 5.16.2:
> 
> Configured by strawberry-perl at Fri Nov  2 00:34:53 2012.
> 
> Summary of my perl5 (revision 5 version 16 subversion 2)
>    configuration:
>      Platform:
>     osname=MSWin32, osvers=4.0, archname=MSWin32-x86-multi-thread
>     uname='Win32 strawberry-perl 5.16.2.1 #1 Fri Nov  2 00:33:54 2012
>    i386'
>     config_args='undef'
>     hint=recommended, useposix=true, d_sigaction=undef
>     useithreads=define, usemultiplicity=define
>     useperlio=define, d_sfio=undef, uselargefiles=define,
>    usesocks=undef
>     use64bitint=undef, use64bitall=undef, uselongdouble=undef
>     usemymalloc=n, bincompat5005=undef
>   Compiler:
>     cc='gcc', ccflags =' -s -O2 -DWIN32  -DPERL_TEXTMODE_SCRIPTS
>    -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -fno-strict-aliasing
>    -mms-bitfields',
>     optimize='-s -O2',
>     cppflags='-DWIN32'
>     ccversion='', gccversion='4.6.3', gccosandvers=''
>     intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
>     d_longlong=undef, longlongsize=8, d_longdbl=define, longdblsize=12
>     ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='long
>    long', lseeksize=8
>     alignbytes=8, prototype=define
>   Linker and Libraries:
>     ld='g++', ldflags ='-s -L"C:\strawberry\perl\lib\CORE"
>    -L"C:\strawberry\c\lib"'
>     libpth=C:\strawberry\c\lib C:\strawberry\c\i686-w64-mingw32\lib
>     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=libperl516.a
>     gnulibc_version=''
>   Dynamic Linking:
>     dlsrc=dl_win32.xs, dlext=dll, d_dlsymun=undef, ccdlflags=' '
>     cccdlflags=' ', lddlflags='-mdll -s
>    -L"C:\strawberry\perl\lib\CORE" -L"C:\strawberry\c\lib"'
> 
> Locally applied patches:
> 
> ---
> @INC for perl 5.16.2:
>     C:/strawberry/perl/site/lib/MSWin32-x86-multi-thread
>     C:/strawberry/perl/site/lib
>     C:/strawberry/perl/vendor/lib
>     C:/strawberry/perl/lib
>     .
> 
> ---
> Environment for perl 5.16.2:
>     HOME (unset)
>     LANG (unset)
>     LANGUAGE (unset)
>     LD_LIBRARY_PATH (unset)
>     LOGDIR (unset)
>     PATH=C:\Program Files (x86)\ImageMagick-6.8.3-Q16;C:\Program
>    Files\ImageMagick-6.8.3-Q16;C:\Program Files (x86)\NVIDIA
>    Corporation\PhysX\Common;C:\Program Files (x86)\PC Connectivity
>    Solution\;C:\Program Files\Common Files\Microsoft Shared\Windows
>    Live;C:\Program Files
>   
(x86)\PHP\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program
>    Files\jEdit;C:\usr\local\ppt\bin;C:\Program Files
>    (x86)\GnuWin32\bin;C:\Program Files (x86)\Smart
>    Projects\IsoBuster;C:\Program Files (x86)\Oracle\Berkeley DB 11gR2
>    5.3.15\bin;C:\Program Files (x86)\Git\cmd;C:\Program Files
>    (x86)\Calibre2\;C:\Program Files (x86)\Bazaar;C:\Program Files
>    (x86)\Lua\5.1;C:\Program Files
>   
(x86)\Lua\5.1\clibs;C:\strawberry\c\bin;C:\strawberry\perl\site\bin;C:\strawberry\perl\bin;C:\Program
>    Files\TortoiseSVN\bin;C:\MediaInfoCLI;C:\Program Files
>    (x86)\MKVToolNix;C:\Program Files\WinRAR;C:\Program Files\Common
>    Files\Microsoft Shared\Windows Live;C:\Program Files (x86)\Co
> mmon Files\Hackety Hack\0.r1529\..;C:\Program Files (x86)\IDM Computer
>    Solutions\UltraCompare\;C:\ffmpeg\bin;C:\Program Files
>    (x86)\Serviio\lib;C:\Program Files (x86)\Microsoft Visual Studio
>    10.0\VC\bin\x86_amd64;C:\Program Files (x86)\Microsoft Visual
>    Studio
>   
10.0\VC\bin\amd64;C:\SWIG;C:\MinGW\bin;C:\MinGW\MSYS\1.0\bin;C:\Python27;C:\Curl;C:\pkg-
>    config\bin;C:\glib\bin;C:\gettext-runtime\bin;C:\Program Files
>    (x86)\IDM Computer Solutions\UltraEdit\;C:\LuaRocks\2.0;C:\Program
>    Files (x86)\Android\android-sdk\platform-
>    tools;C:\Ruby193\bin;C:\Ruby193.DevKit\bin;C:\Program Files
>    (x86)\Nmap;C:\Program Files (x86)\EaseUS\Todo
>    Backup\bin\x64\;C:\Program Files (x86)\TextPad 6
>     PERL_BADLANG (unset)
>     SHELL (unset)




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

Thread Previous | 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