File: xml-writer-string.pl

package info (click to toggle)
libxml-writer-perl 0.615-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 220 kB
  • sloc: perl: 2,467; makefile: 2
file content (19 lines) | stat: -rwxr-xr-x 258 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/usr/bin/perl -w

# Write to a string, then print the output

use strict;

use XML::Writer;

my $s;

my $w = XML::Writer->new(OUTPUT => \$s);

$w->startTag('doc');
$w->characters('text');
$w->endTag('doc');
$w->end();

# Print the string contents
print $s