# get_all_Genes returns returns a list reference #each item in the list is a gene reference # Iterate through all of the genes on a clone foreach my $gene ( @{ $first_clone->get_all_Genes() } ) { print $gene->stable_id(), "\n"; } # More memory efficient way of doing the same thing my $genes = $first_clone->get_all_Genes(); while ( my $gene = shift @{$genes} ) { print $gene->stable_id(), "\n"; }