Implements the Perl 6 'gather/take' control structure in Perl 5