/
README
86 lines (57 loc) · 2.01 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
NAME
File::Temp::Trace - Trace the creation of temporary files
VERSION
Version 0.03
REQUIREMENTS
The following packages are required:
Attribute::Handlers
Carp
File::Path
File::Spec
File::Temp
overload
Scalar::Util
self
SYNPOSIS
package MyPkg;
use File::Temp::Trace;
my $tmp = File::Temp::Trace->tempdir();
print STDERR "New temporary directory ${tmp} created.";
sub create_file : skip_temp_log {
my ($tmp, $ext) = @_;
return $tmp->tempfile( suffix => $ext );
}
sub create_text {
my ($tmp, $ext) = @_;
return create_file($tmp, '.txt');
}
my $fh = create_text($tmp);
# $fh->filename will be named "MyPkg-create_text-XXXXXXXX.txt",
# where XXXXXXXX is a unique string.
DESCRIPTION
This module allows you to trace the creation of temporary files. By
default, these files are all created in the same directory, and their
names are prefixed by the name of the function or method that created
them.
You can optionally log the creation of temporary files with a stack
trace as well.
REVISION HISTORY
Revision history for File-Temp-Trace
0.03
Documented a known issue with attributes.
Removed BEGIN block and simplified variable initialisation.
Removed use of self module.
0.02 Sun Jun 19 17:00:53 BST 2011
Version ready for CPAN.
0.01 Sat Jun 18 12:35:53 BST 2011
Prototype version uploaded to github
SEE ALSO
File::Temp
AUTHOR
Robert Rothenberg, `<rrwo@cpan.org>'
LICENSE AND COPYRIGHT
Copyright 2011 Robert Rothenberg.
This program is free software; you can redistribute it and/or modify it
under the terms of either: the GNU General Public License as published
by the Free Software Foundation; or the Artistic License.
See http://dev.perl.org/licenses/ for more information.