sub generate { my ($self, $OBJS) = @_; # NOTE: # $OBJS is an array of objects, and array elements can also be arrays of objects while(SOMETHING) { if ($OBJS) { # we got anything? if (scalar(@{$OBJS})) { # 0-length array is useless my $OBJ = shift(@{$OBJS}); DO MEAN STUFF TO THE OBJ } } } return LA-LA; } #### my $OBJScopy; foreach my $obj (@$OBJS) { push(@{$OBJScopy}, clone($obj)); }