in reply to Re: XML::Simple
in thread How to access results of XML::Simple?

Instead of this:

my $xml = XMLin($data);

I'd recommend this:

my $genes = XMLin($data, keyattr => { gene => 'id' }, forcearray => [ 'gene' ], );

My reasoning:

The XML::Simple strict mode node expands on this theme.

Also, you could give XMLin() the DATA globref directly:

XMLin(\*DATA, ...);

Replies are listed 'Best First'.
Re: Re: Re: XML::Simple
by BrowserUk (Patriarch) on Dec 18, 2002 at 02:20 UTC

    Agreed. I actually had both options on in my first version, but then decided that as the process works without, it might only serve to confuse the OP, and removed them.

    Possibly the wrong thing to do in hindsight, but I figured less noise, more clarity?

    Same goes for using GLOB's, I still steer clear of them personally, but it would better in production code.


    Examine what is said, not who speaks.