cancel
Showing results for 
Search instead for 
Did you mean: 

using xml::simple

SOLVED
Go to solution
itai weisman
Super Advisor

using xml::simple

Hi All,
new to xml reading in perl,
I'm trying to read command's output using xml::simple. I do not want to direct the command output to file and then read it using XMLin.
do you know how can I do that?
thanks,
Itai
2 REPLIES
Goran Koruga
Honored Contributor
Solution

Re: using xml::simple

Hello.

You can read the whole output of your commaind in a variable and then pass that string to XML::Simple.

You can also pass it a file handle and that should be enough to not need to redirect command's output to a file:

use IO::Handle;

my $FH = new IO::Handle;

open($FH, "command |");

Now you can pass this to XML::Simple (note the lack of error checking).

Regards,
Goran
Ali
HPE Pro

Re: using xml::simple

Hi Itai,

Another way to read XML is through
XML::LibXML

might be helpful
http://perl-xml.sourceforge.net/faq/#xml_simple

Thanks,
Aftab
I work for HP
Looking for a quick resolution to a technical issue for your HP Enterprise products? HP Support Center Knowledge-base – Just a Click Away!
See Self Help Post for more details