Convert Pod::Html to lexical file handles.
authorNicholas Clark <nick@ccl4.org>
Fri, 4 Feb 2011 09:42:28 +0000 (10:42 +0100)
committerNicholas Clark <nick@ccl4.org>
Fri, 4 Feb 2011 09:53:56 +0000 (10:53 +0100)
commit7319fd7fc0619d07356aa598ec397e9bab34167f
treee26e0a0bd2f23831bb582f23d7c5efe5d7eaaeb1
parent44de791afe7466121840ad5d8e4a0b7694f4c34e
Convert Pod::Html to lexical file handles.

This fixes the regression test failures for Module::Build on an NFS filesystem.
What had been happening was that 3 of Module::Build's tests would invoke
Pod::Html::pod2html via ACTION_html(). The invocation is inside an eval, and
is not treated as fatal if it fails. It fails if the install tree doesn't yet
exist, and it doesn't explicitly close the file handle. With package file
handles, this meant that the file was still open when the test attempted to
recursively delete the temporary directory tree, and an NFS file system won't
delete an open file (it will reappear under a different, hidden, filename).
Consequently the directory tree was not empty, cleanup failed, and the test
failed.

Switching to lexical file handles causes the file to automatically be closed
when it goes out of scope due to the thrown exception. This problem is not
going to occur for anyone building Module::Build on NFS against an installed
perl.
ext/Pod-Html/Html.pm