Need some help with XMLin

Need some help with XMLin

am 28.05.2008 18:02:49 von Vasant Kumar

Hi,
I'm using PERL for the first time, and I need to parse an XML
Document.

Essentially we have a file that's structures like this












now when I do something like
$data = XMLin($XML, forcearray => ["C"]);

It has something similar to

$VAR1 = { B => { C => [ {1}, {2}. {3} ]}

Now accessing B is no problem, but I want to access the values in C..
do you know how this might be possible?

Thank you,
Vasant


--
To unsubscribe, e-mail: beginners-unsubscribe@perl.org
For additional commands, e-mail: beginners-help@perl.org
http://learn.perl.org/

Re: Need some help with XMLin

am 29.05.2008 10:45:19 von peng.kyo

On Thu, May 29, 2008 at 12:02 AM, Vasant Kumar wrote:

>
> $VAR1 = { B => { C => [ {1}, {2}. {3} ]}
>
> Now accessing B is no problem, but I want to access the values in C..

Hello,

$VAR1->{B}->{C}->[0];
will get the first element of the anonymous array whose KEY is C.

--
Jeff Peng - Peng.Kyo@Gmail.com
Professional Squid supports in China
http://www.ChinaSquid.com/

--
To unsubscribe, e-mail: beginners-unsubscribe@perl.org
For additional commands, e-mail: beginners-help@perl.org
http://learn.perl.org/