>>>>> "d" == dblack <dblack@superlink.net> writes:
d> $ ./ruby -e 'p ["a"].inject("start") {|x,y| break "b"}'
d> "start"
d> I'm still not understanding why these should be different, or how
d> "start" gets into the first one (the first block) at all.
svg% ruby -e 'p ["x", "y"].inject("a") {|x,y| break 12 if y == "y"; x + y}'
"ax"
svg%
#inject ignore the value returned by break, and return the last result.
In your case, because it exit at the first iteration it return the initial
value "start"
Guy Decoux