tags:

views:

86

answers:

2

XML::Simple documentation says to initiate the data structure with an XML file, using XMLin('[FILENAME]') ... but I have an in-memory string.

Can I use it directly, or do I need to save it to the filesystem and then load it into XMLin?

+1  A: 

It also says

my $ref = $xs->XMLin([<xml file or string>] [, <options>]);
zakovyrya
+4  A: 

You seem to have missed in said documentation the following information:

XMLin() accepts an optional XML specifier followed by zero or more 'name => value' option pairs. The XML specifier can be one of the following:

...

A string of XML

A string containing XML (recognised by the presence of '<' and '>' characters) will be parsed directly. eg:

  $ref = XMLin('<opt username="bob" password="flurp" />');
Sinan Ünür
my (noobie) apologies... was reading the FAQ. stupid.
mblackwell8