my $i = $foo->get_big_list; while (my $element = $i->next) { # do stuff to $element }; #### # in your class sub apply_to_elements { my ($self, $coderef) = @_; $coderef->($_) foreach @{ $self->{'Big_List'} }; }; # somewhere else $foo->apply_to_elements( sub { my $element = shift; # do stuff to $element } );