in reply to Parsing STDOUT ?

XML::Simple is your friend:
my $ref = XMLin([<xml file or string>] [, <options>]);
Never mind, that won't work from STDOUT, you'll have to tie first, as explained in the RRDTool::OO documentation:

Dumps the RRD in XML format to STDOUT. If you want to dump it into a file instead, do this:
my $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;
Just replace the last couple of lines by
use XML::Simple; my $data = join '', <DUMP>; my $ref = XMLin($data);
and you'll have the data structure in $ref.

Replies are listed 'Best First'.
Re^2: Parsing STDOUT ?
by Anonymous Monk on Feb 08, 2006 at 02:29 UTC
    I seem to get this error on windows:
    '-' is not recognized as an internal or external command, operable program or batch file.
    Any idea why?