in reply to Re^2: readline on closed filehandle
in thread readline on closed filehandle

It would be appreciated if you would share what you did to correct your mistake/misunderstanding, so that future readers will learn as well.