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
?
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
?
It also says
my $ref = $xs->XMLin([<xml file or string>] [, <options>]);
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" />');