While working on a long-running program, I ran across a file descriptor leak. In this instance, I'm using the CDialog backend, but the actual problem is in UI::Dialog::Backend::gen_tempfile_name() when using File::Temp. The call to tempfile() returns an open filehandle, which is often discarded and results in a file descriptor leak.
I've attached a small script which demos the issue directly with File::Temp. Related to this, I've found that the tempfile() method results in the temporary files being deleted when the program terminates (unless ctrl-C is hit), whereas the OO method will delete the tempfile when the object is destroyed. For a long running program (like mine), deleting temporary files after use would be nicer.
Thanks for making this very nice module!
demonstrate file descriptor leak