in reply to FileHandle: undef vs close

undef will close the filehandle, just as close. The difference is that the return value of undef is always undef, while close will return false if there's a failure. Most likely you won't care about failures on closing a handle you have open for reading, but you ought to check for failures when closing a file you've written data to.

I cannot recall the last time I undeffed a filehandle. I either close the filehandle explicitely, let the filehandle go out of scope, or reuse the handle in a different open.