in reply to Re^4: Loop through array or filehandle
in thread Loop through array or filehandle

The call to create_iter should not be in the while loop, create_iter should be called only once, to obtain the right iterator.

What should go into the while condition is the call to the iterator returned by create_iter (i.e. $iter->() in my sample code).