Subject: | Enhance RATIONALE in Pod |
Here are the snippets from my annocpan annotations, not a formal patch.
I'll left the final labour to the author...
I think there's need for a better rationale. The problems mentioned here
are solved by the standard perl module File::Temp:
$TESTDIR = tempdir(TMPDIR => 1, CLEANUP => 1)
----------------------------------------------------------------------
use File::Temp qw(tempdir);
use File::Spec::Functions qw(catfile);
my $TMPDIR = tempdir(CLEANUP => 1, TMPDIR => 1);
for (1..5) {
my $tmpfile = catfile($TMPDIR, "tempfile.$_");
open my $fh, ">", $tmpfile or die $!;
warn $tmpfile;
my $tmpdir = catfile($TMPDIR, "tempdir.$_");
mkdir $tmpdir or die $!;
warn $tmpdir;
}
__END__
My point is: the cleanup functionality is already there in File::Temp.
You should really use an example using File::Temp to compare with
Directory::Scratch. This will make the difference smaller, sure.
And if File::Temp does not work on exotic operating systems, then this
should be described in this rationale (e.g. "File::Temp is broken on
VMS, Win, ...").
Also, make the two examples equivalent. The first example writes
something to the opened file, while the second does not do so. So the
three lines in the first example could be squeezed to just one.
I won't debate about the introduction of "touch" or similar methods.
This indeed looks nicer than using open. And it's also nice that it's
not necessary to use File::Spec::catfile.
-------------------------------------------------------------------
Regards,
Slaven