line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
=head1 NAME
|
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
XML::Writer::String - Capture output from XML::Writer.
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
=cut
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
package XML::Writer::String;
|
8
|
|
|
|
|
|
|
require 5.004;
|
9
|
1
|
|
|
1
|
|
5086
|
use warnings;
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
27
|
|
10
|
1
|
|
|
1
|
|
5
|
use strict;
|
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
191
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
$XML::Writer::String::VERSION = 0.1;
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub new {
|
15
|
0
|
|
|
0
|
1
|
|
my $class = shift;
|
16
|
0
|
|
|
|
|
|
my $scalar = '';
|
17
|
0
|
|
|
|
|
|
my $self = bless \$scalar, $class;
|
18
|
0
|
0
|
|
|
|
|
$self->value(@_) if @_;
|
19
|
0
|
|
|
|
|
|
return $self;
|
20
|
|
|
|
|
|
|
}
|
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub print {
|
23
|
0
|
|
|
0
|
1
|
|
my $self = shift;
|
24
|
0
|
|
|
|
|
|
${$self} .= join '', @_;
|
|
0
|
|
|
|
|
|
|
25
|
0
|
|
|
|
|
|
return scalar(@_);
|
26
|
|
|
|
|
|
|
}
|
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
sub value {
|
29
|
0
|
|
|
0
|
1
|
|
my $self = shift;
|
30
|
0
|
|
|
|
|
|
@_ ? ${$self} = join('', @_)
|
|
0
|
|
|
|
|
|
|
31
|
0
|
0
|
|
|
|
|
: ${$self};
|
32
|
|
|
|
|
|
|
}
|
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
1;
|
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
__END__
|