FW: How do I build a associative array from a dyanamic list

Ben Goswami (ben.goswami@infospace.com)
Wed, 11 Apr 2001 11:28:14 -0700


------=_NextPart_000_006A_01C0C27A.80555AD0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: 7bit

hi,

How can I create a associative array from an unknown list of entities.  As
we don't have an equivalent of 'add' or 'push' function for the associative
array.
for example: I'm trying to parse an xml file and create an nested
associative array. The number of 'items' element in the source data may be
varying.


I've attached the xml:

the only in the docs I see about this is this:
***************************
How can I store a multidimensional array in a DBM file?
Either stringify the structure yourself (no fun), or else get the MLDBM
(which uses Data::Dumper) module from CPAN and layer it on top of either
DB_File or GDBM_File.
********************

Is there any other way
thx
ben




------=_NextPart_000_006A_01C0C27A.80555AD0
Content-Type: text/xml;
	name="cart.xml"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
	filename="cart.xml"

<response><cart><id>1018857056</id><item><id>1234</id><name>fsdfdsf</name=
><price>23.45</price><quantity>11</quantity><availability>4000</availabil=
ity><variation><id>123</id><name>size</name><value>large</value></variati=
on><variation><id>234</id><name>color</name><value>blue</value></variatio=
n></item><billing><contact><firstname>fname</firstname><lastname>lname</l=
astname><add1>add1</add1><add2>add2</add2><company>company1</company><cit=
y>city1</city><state>ca</state><zip>12345</zip><phone>null</phone></conta=
ct></billing><shipping><shippingmethod>one day =
air</shippingmethod><contact><firstname>fname</firstname><lastname>lname<=
/lastname><add1>add1</add1><add2>add2</add2><company>company1</company><c=
ity>city1</city><state>ca</state><zip>12345</zip><phone>null</phone></con=
tact></shipping><payment><type>VISA</type><ccnum>4111111111111111</ccnum>=
<cardholder>bigdaddy</cardholder><expmonth>jan</expmonth><expyr>2006</exp=
yr></payment><tax>8.1</tax></cart></response>
------=_NextPart_000_006A_01C0C27A.80555AD0--