in reply to Re: Another reduce bug?
in thread Another reduce bug?

Ha! Thanks for the confirmation. It is a strange one. Following on from your use an array solution, I tried the ol' put it in a list context trick--which is probably a erroneous name, but it serves-- and voila. That also fixes it. Maybe an interation between two different optimisations? Time for a perlbug I think.

my @r; reduce{ print "$a:$b"; push @r, [ $a, $b ]; $b; } () = split ' ', $s;

Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
"Too many [] have been sedated by an oppressive environment of political correctness and risk aversion."

Replies are listed 'Best First'.
Re^3: Another reduce bug? (()=)
by tye (Sage) on Aug 16, 2007 at 03:51 UTC

    I expect that to make reduce() loop over an empty list and, for me, that is what it does. So, at least in my environment, I don't see how that qualifies as "fixing".

    - tye