On 2006-09-06 10:26, John <> wrote:
><city>
> <firm>
> <employee>Fred</employee>
> <employee>Bill</employee>
> <employee>Bob</employee>
> </firm>
></city>
That's nice, but if it does it already contained that before parsing,
too. Parsing the above data with XML::Simple results in:
$VAR1 = {
'firm' => {
'employee' => [
'Fred',
'Bill',
'Bob'
]
}
};
> I need to know how many employees?
Isn't that quite obvious from the data structure?
scalar @{ $VAR1->{firm}{employee} }
> I can easily extract each employeee but I only need the count. Is
> there an easier way?
An easier way than what?
hp
--
_ | Peter J. Holzer | > Wieso sollte man etwas erfinden was nicht
|_|_) | Sysadmin WSR | > ist?
| | |
| Was sonst wäre der Sinn des Erfindens?
__/ |
http://www.hjp.at/ | -- P. Einstein u. V. Gringmuth in desd