line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package DataFlow::Proc::SimpleFileOutput; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
1691
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
29
|
|
4
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
40
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
# ABSTRACT: A processor that writes data to a file |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
our $VERSION = '1.121830'; # VERSION |
9
|
|
|
|
|
|
|
|
10
|
1
|
|
|
1
|
|
444
|
use Moose; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
extends 'DataFlow::Proc'; |
12
|
|
|
|
|
|
|
with 'DataFlow::Role::File'; |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
use namespace::autoclean; |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
has 'ors' => ( |
17
|
|
|
|
|
|
|
'is' => 'ro', |
18
|
|
|
|
|
|
|
'isa' => 'Str', |
19
|
|
|
|
|
|
|
'lazy' => 1, |
20
|
|
|
|
|
|
|
'default' => "\n", |
21
|
|
|
|
|
|
|
'predicate' => 'has_ors', |
22
|
|
|
|
|
|
|
'documentation' => 'Output record separator', |
23
|
|
|
|
|
|
|
); |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub _build_p { |
26
|
|
|
|
|
|
|
my $self = shift; |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
return sub { |
29
|
|
|
|
|
|
|
my $fh = $self->file; |
30
|
|
|
|
|
|
|
local $\ = $self->ors if $self->has_ors; |
31
|
|
|
|
|
|
|
print $fh $_; |
32
|
|
|
|
|
|
|
return $_; |
33
|
|
|
|
|
|
|
}; |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
1; |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
__END__ |
42
|
|
|
|
|
|
|
=pod |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
=encoding utf-8 |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
=head1 NAME |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
DataFlow::Proc::SimpleFileOutput - A processor that writes data to a file |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
=head1 VERSION |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
version 1.121830 |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
=head1 SEE ALSO |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
Please see those modules/websites for more information related to this module. |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
=over 4 |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
=item * |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
L<DataFlow|DataFlow> |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
=back |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
=head1 AUTHOR |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
Alexei Znamensky <russoz@cpan.org> |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
This software is copyright (c) 2011 by Alexei Znamensky. |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
75
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
=head1 BUGS AND LIMITATIONS |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
You can make new bug reports, and view existing ones, through the |
80
|
|
|
|
|
|
|
web interface at L<http://rt.cpan.org>. |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
=head1 DISCLAIMER OF WARRANTY |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY |
85
|
|
|
|
|
|
|
FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT |
86
|
|
|
|
|
|
|
WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER |
87
|
|
|
|
|
|
|
PARTIES PROVIDE THE SOFTWARE "AS IS" WITHOUT WARRANTY OF ANY KIND, |
88
|
|
|
|
|
|
|
EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE |
89
|
|
|
|
|
|
|
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
90
|
|
|
|
|
|
|
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE |
91
|
|
|
|
|
|
|
SOFTWARE IS WITH YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME |
92
|
|
|
|
|
|
|
THE COST OF ALL NECESSARY SERVICING, REPAIR, OR CORRECTION. |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING |
95
|
|
|
|
|
|
|
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR |
96
|
|
|
|
|
|
|
REDISTRIBUTE THE SOFTWARE AS PERMITTED BY THE ABOVE LICENCE, BE LIABLE |
97
|
|
|
|
|
|
|
TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL, OR |
98
|
|
|
|
|
|
|
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE |
99
|
|
|
|
|
|
|
SOFTWARE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING |
100
|
|
|
|
|
|
|
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A |
101
|
|
|
|
|
|
|
FAILURE OF THE SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF |
102
|
|
|
|
|
|
|
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH |
103
|
|
|
|
|
|
|
DAMAGES. |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
=cut |
106
|
|
|
|
|
|
|
|