1Test::Trap::Builder::TeUmspeFrilCeo(n3t)ributed Perl DocTuemsetn:t:aTtriaopn::Builder::TempFile(3)
2
3
4
6 Test::Trap::Builder::TempFile - Capture strategies using File::Temp
7
9 Version 0.3.4
10
12 This module by default provides a capture strategy based on File::Temp
13 for the trap's output layers.
14
15 The import accepts a name (as a string; default tempfile) and options
16 (as a hashref; by default empty), and registers a capture strategy with
17 that name and a variant implementation based on the options.
18
19 Note that you may specify different strategies for each output layer on
20 the trap.
21
22 See also Test::Trap (:stdout and :stderr) and Test::Trap::Builder
23 (output_layer).
24
26 The following options are recognized:
27
28 preserve_io_layers
29 A boolean, indicating whether to apply to the handles writing to and
30 reading from the tempfile, the same perlio layers as are found on the
31 to-be-trapped output handle.
32
33 io_layers
34 A colon-separated string representing perlio layers to be applied to
35 the handles writing to and reading from the tempfile.
36
37 If the preserve_io_layers option is set, these perlio layers will be
38 applied on top of the original (preserved) perlio layers.
39
41 Using File::Temp, we need privileges to create tempfiles.
42
43 We need disk space for the output of every trap (it should clean up
44 after the trap is sprung).
45
46 Disk access may be slow -- certainly compared to the in-memory files of
47 PerlIO.
48
49 If the options specify (explicitly or via preserve on handles with)
50 perlio custom layers, they may (or may not) fail to apply to the
51 tempfile read and write handles.
52
53 Threads? No idea. It might even work correctly.
54
56 Please report any bugs or feature requests directly to the author.
57
59 Eirik Berg Hanssen, "<ebhanssen@cpan.org>"
60
62 Copyright 2006-2014 Eirik Berg Hanssen, All Rights Reserved.
63
64 This program is free software; you can redistribute it and/or modify it
65 under the same terms as Perl itself.
66
67
68
69perl v5.32.0 2020-07-28 Test::Trap::Builder::TempFile(3)