You have the correct answer. And indeed it is addressed
in the documentation. unlink0 performs checks that
depend on having both the filename and the open filehandle,
and if you do the close yourself it cannot verify that the
close was safe.
Re: tilly (4) scratching the surface of File::Temp (unlink w/o $filehandle ?)