http://www.perlmonks.org?node_id=509556


in reply to Re^3: OT: Ruby On Rails - your thoughts?
in thread OT: Ruby On Rails - your thoughts?

[ fields[ 1..4 ], fields[ 4..5 ], 0, 0 ].flatten should work in Ruby; passing a range to Array#[] returns the specified subarray.

Update: And additionally it'd be more idiomatic to use do . . . end rather than {} around your blocks. Granted I don't think it makes a difference in this case but the later does bind more tightly than the former.