my $iter = getIter( $structRef ); while( my $next = $iter->() ) { ## use $next; }