[Bangalore-pm] XML to PERL

promit promitbhattacharya at gmail.com
Fri Nov 8 08:07:30 PST 2013


just check the ds xml simple genertes .
loop over keys of $ref->{IDs}


On Fri, Nov 8, 2013 at 9:05 PM, Satya.. <satya.itguy at gmail.com> wrote:

> The child name is dynamic
> On 8 Nov 2013 16:41, "promit" <promitbhattacharya at gmail.com> wrote:
>
>> just use XML::Simple
>>
>> it will read it into a perl reference and then say something like
>> $ref->{IDs}->{Child1}
>>
>>
>> On Fri, Nov 8, 2013 at 4:30 PM, Satya.. <satya.itguy at gmail.com> wrote:
>>
>>> Hi All,
>>>
>>> We are having one small XML file which has below format
>>>
>>> <IDs>
>>> <*child1*>
>>>  <Group>group1</Group>
>>>  <Code>code1</Code>
>>>  <Division>division1</Division>
>>>  <Department></Department>
>>>  <Class>1512</PSA>
>>> </*child1*>
>>> <*child2*>
>>>  <Group>Group2</Group>
>>>  <Code>Code2</Code>
>>>  <Division></Division>
>>>  <Department></Department>
>>>  <Class>1010, 1015, 1020</PSA>
>>> </*child2*>
>>> ---
>>> ---
>>> ---
>>> </IDs>
>>>
>>>
>>> I need to write a perl script to capture the values into variables
>>>
>>> I got confused how to handle different childs in Perl .. Child1..Child2
>>>
>>> Any sample perl script will be helpful to me
>>>
>>>
>>> -------------------------------------------
>>>
>>> Regards, J
>>> *$@tya..*
>>>
>>>
>>> _______________________________________________
>>> Bangalore-pm mailing list
>>> Bangalore-pm at pm.org
>>> http://mail.pm.org/mailman/listinfo/bangalore-pm
>>>
>>
>>
>>
>> --
>> ~ Sent from a plain old fashioned device called a komputarrrr ;)
>>
>> _______________________________________________
>> Bangalore-pm mailing list
>> Bangalore-pm at pm.org
>> http://mail.pm.org/mailman/listinfo/bangalore-pm
>>
>
> _______________________________________________
> Bangalore-pm mailing list
> Bangalore-pm at pm.org
> http://mail.pm.org/mailman/listinfo/bangalore-pm
>



-- 
~ Sent from a plain old fashioned device called a komputarrrr ;)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.pm.org/pipermail/bangalore-pm/attachments/20131108/f0b62e2b/attachment.html>


More information about the Bangalore-pm mailing list