develooper Front page | perl.perl5.porters | Postings from May 2018

[perl #133155] perl5: false warning on "Multidimensional syntax notsupported"

From:
James E Keenan via RT
Date:
May 7, 2018 22:08
Subject:
[perl #133155] perl5: false warning on "Multidimensional syntax notsupported"
Message ID:
rt-4.0.24-4357-1525730933-784.133155-15-0@perl.org
On Thu, 26 Apr 2018 17:46:39 GMT, wolf-dietrich_moeller@t-online.de wrote:
> 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)

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



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