in reply to Re^15: print() on closed filehandle
in thread print() on closed filehandle

I doubt it is as simple as that; knowing what $^E is when the open fails may provide some insight into what factors make the problem manifest.