Skip Menu |
Report information
Id: 133155
Status: open
Priority: 0/
Queue: perl5

Owner: Nobody
Requestors: wolf-dietrich_moeller [at] t-online.de
Cc:
AdminCc:

Operating System: (no value)
PatchStatus: (no value)
Severity: low
Type: unknown
Perl Version: (no value)
Fixed In: (no value)



To: <perlbug [...] perl.org>
From: Wolf-Dietrich Moeller (Munchen) <wolf-dietrich_moeller [...] t-online.de>
Subject: perl5: false warning on "Multidimensional syntax not supported"
Date: Thu, 26 Apr 2018 19:46:17 +0200
Download (untitled) / with headers
text/plain 3.3k
Hi, I found a false warning on "Multidimensional syntax". The test program below is executed correctly, but line 7 triggers a false warning. This is surprising, as the other 'print' lines have a similar structure without raising this warning. Why should this be raised here? From the syntax it is clear that both variables are parameters of "index", as it has (at least) two arguments. Best regards Wolf ### Start test program 'test_index.pl' ### use warnings; my @x = (['a','b']); my @y = ('a','b'); my $z = 'rst'; my $i = 's'; print ' 6: ',$x[0][index $z,$i],"\n"; print ' 7: ',$y[index $z,$i],"\n"; print ' 8: ',$y[index($z,$i)],"\n"; print ' 9: ',$y[index 'rst',$i],"\n"; print '10: ',@y[index $z,$i],"\n"; ### end test program ### Output: Multidimensional syntax $y[index $z,$i] not supported at test_index.pl line 7. 6: b 7: b 8: b 9: b 10: b ----------------------------------------------------------------- --- Flags: category=core severity=low --- Site configuration information for perl 5.26.2: Configured by strawberry-perl at Sun Apr 15 11:47:59 2018. Summary of my perl5 (revision 5 version 26 subversion 2) configuration: Platform: osname=MSWin32 osvers=10.0.16299.371 archname=MSWin32-x86-multi-thread-64int uname='Win32 strawberry-perl 5.26.2.1 #1 Sun Apr 15 11:47:13 2018 i386' config_args='undef' hint=recommended useposix=true d_sigaction=undef useithreads=define usemultiplicity=define use64bitint=define use64bitall=undef uselongdouble=undef usemymalloc=n default_inc_excludes_dot=define bincompat5005=undef Compiler: cc='gcc' ccflags =' -s -O2 -DWIN32 -D__USE_MINGW_ANSI_STDIO -DPERL_TEXTMODE_SCRIPTS -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DUSE_PERLIO -fwrapv -fno-strict-aliasing -mms-bitfields' optimize='-s -O2' cppflags='-DWIN32' ccversion='' gccversion='7.1.0' 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\7.1.0 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=libperl526.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.26.2: C:/Perl/perl/site/lib C:/Perl/perl/vendor/lib C:/Perl/perl/lib --- Environment for perl 5.26.2: HOME (unset) LANG (unset) LANGUAGE (unset) LD_LIBRARY_PATH (unset) LOGDIR (unset) PATH=... PERL_BADLANG (unset) SHELL (unset)
RT-Send-CC: perl5-porters [...] perl.org
Download (untitled) / with headers
text/plain 1.1k
On Thu, 26 Apr 2018 17:46:39 GMT, wolf-dietrich_moeller@t-online.de wrote: Show quoted text
> Hi, > I found a false warning on "Multidimensional syntax". > The test program below is executed correctly, but line 7 > triggers a false warning. This is surprising, as the other > 'print' lines have a similar structure without raising this > warning. Why should this be raised here? From the syntax it > is clear that both variables are parameters of "index", as > it has (at least) two arguments. > > Best regards > Wolf > > ### Start test program 'test_index.pl' ### > use warnings; > my @x = (['a','b']); > my @y = ('a','b'); > my $z = 'rst'; > my $i = 's'; > print ' 6: ',$x[0][index $z,$i],"\n"; > print ' 7: ',$y[index $z,$i],"\n"; > print ' 8: ',$y[index($z,$i)],"\n"; > print ' 9: ',$y[index 'rst',$i],"\n"; > print '10: ',@y[index $z,$i],"\n"; > ### end test program ### > > Output: > Multidimensional syntax $y[index $z,$i] not supported at test_index.pl line > 7. > 6: b > 7: b > 8: b > 9: b > 10: b > >
I've been able to reproduce this in perl-5.24.1. Hence, it's not a regression introduced in the 5.27 development cycle and is not a blocker for 5.28.0. Thank you very much. -- James E Keenan (jkeenan@cpan.org)


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at perl.org