{ my @list; sub gather (&) { my( $sub ) = @_; push @list, []; $sub->(); return @{ pop @list }; } # gather sub take { push @{ $list[-1] }, @_ } }