in reply to Parsing STDOUT ?
my $ref = XMLin([<xml file or string>] [, <options>]);
Dumps the RRD in XML format to STDOUT. If you want to dump it into a file instead, do this:Just replace the last couple of lines bymy $pid; unless ($pid = open DUMP, "-|") { die "Can't fork: $!" unless defined $pid; $rrd->dump(); exit 0; } waitpid($pid, 0); open OUT, ">out"; print OUT $_ for <DUMP>; close OUT;
and you'll have the data structure in $ref.use XML::Simple; my $data = join '', <DUMP>; my $ref = XMLin($data);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Parsing STDOUT ?
by Anonymous Monk on Feb 08, 2006 at 02:29 UTC |