in reply to Another reduce bug?
You're not missing anything. I observe the same bug. The following two variations make the problem disappear.
Using pure perl version of List::Util
#! perl -slw use strict; BEGIN {$List::Util::TESTING_PERL_ONLY = 1}; use List::Util qw[ reduce ]; my $s = 'this is a test'; my @r; reduce { print "$a:$b"; push @r, [ $a, $b ]; $b; } split ' ', $s;
Or passing an array instead of the split:
- Miller#! perl -slw use strict; use List::Util qw[ reduce ]; my $s = 'this is a test'; my @s = split ' ', $s; my @r; reduce { print "$a:$b"; push @r, [ $a, $b ]; $b; } @s;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Another reduce bug?
by BrowserUk (Patriarch) on Aug 16, 2007 at 02:43 UTC | |
by tye (Sage) on Aug 16, 2007 at 03:51 UTC |