[Warszawa-pm] Bug in Perl: Strange $_ inside 'for' nested in 'map'
Stanislaw Romanski
stas w datos.pl
Śro, 26 Lis 2014, 07:08:40 PST
Hej,
Father Chrysostomos właśnie to naprawił - w commicie jest obszerny komentarz
http://perl5.git.perl.org/perl.git/commitdiff/0f602692a
Stanisław
----- Original Message -----
From: "Tadeusz Sośnierz" <tadeusz.sosnierz w onet.pl>
To: <warszawa-pm w pm.org>
Sent: Wednesday, November 26, 2014 12:56 PM
Subject: Re: [Warszawa-pm] Bug in Perl: Strange $_ inside 'for' nested in
'map'
> On 26.11.2014 12:28, Stanislaw Romanski wrote:
>> Cześć,
>>
>> Muszę się pochwalić: znalazłem prawdziwy błąd w Perlu !
>> Oto w miarę minimalny przykład:
>> =================================================
>> #!perl -w
>> # test447.pl
>> # With the commented-out instruction in the line 11
>> # - this code prints strange values for the table elements of indices 1
>> and 2. Why ?
>> # Un-commenting the line 11 - or inserting any other instruction inside
>> 'map' or 'for'
>> # - makes the code to run properly. Bug or feature ?
>>
>> use strict;
>> use warnings;
>> map {
>> # my $this_instruction_seems_to_be_completely_irrelevant = 111;
>> for (my $i = 0; $i <= 0; $i++ ) {
>> print "$_\n";
>> }
>> } ('abc', 'def', 'ghi', 'jkl', 'mno');
>> =================================================
>
> Wow, ten zakomentowany kod który zmienia sytuację wygląda bardzo ciekawie
> :) Możesz podesłać link do fixa? Znalazłem Twój bug na
> http://www.nntp.perl.org/group/perl.perl5.porters/, ale nie mogę się
> nigdzie dopatrzyć rozwiązania.
>
> Pozdrawiam,
> Tadek
>
> _______________________________________________
> Warszawa-pm mailing list
> Warszawa-pm w pm.org
> http://mail.pm.org/mailman/listinfo/warszawa-pm
>
Więcej informacji o liście Warszawa-pm