1753963 Members
7127 Online
108811 Solutions
New Discussion юеВ

Re: 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 2
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 HPE
Looking for a quick resolution to a technical issue for your HPE products? HPE Support Center Knowledge-base тАУ Just a Click Away!
See Self Help Post for more details

Accept or Kudo