in reply to I get "not a HASH reference" when parsing an XML file

Hi,

Thank you to all of you for your answers.
I've tested the 3 scripts (at home) and all of them work, except the 1st one which ends correctly but does not display the sub-target names.
If everybody agrees on the fact that it is better to use the LibXML library, then I'll use it. If it is not already installed on the stations at work, I'll request for it.
I didn't know the "say" feature. I'll have a look at it to better understand what it does.

Regards.

Xuo.
  • Comment on Re: I get "not a HASH reference" when parsing an XML file

Replies are listed 'Best First'.
Re^2: I get "not a HASH reference" when parsing an XML file
by haukex (Archbishop) on Apr 13, 2020 at 09:42 UTC
    If everybody agrees on the fact that it is better to use the LibXML library

    Definitely don't use XML::Simple! Next to XML::LibXML, there are other good XML modules out there, such as XML::Twig or XML::Rules, each with strengths in certain areas, but XML::LibXML is definitely the most general-purpose. If you're not sure, use XML::LibXML.

    I didn't know the "say" feature. I'll have a look at it to better understand what it does.

    say is equivalent to print with a newline appended. It's available on Perl 5.10 and up when you say use 5.010; or use feature 'say'; at the top of the script.

      Hi,

      Thank you for the explanations. I've just started to search about the 'say' feature, that I've already an answer !!!

      Regards.

      Xuo.