in reply to Asynchronous processes and anonymous handles

$handle goes out of scope after each iteration, thus an implicit close is called. If you want to actually use your file handles you have to store them somewhere.