Re: foreach woes

2006-02-03 Thread Peter Scott
On Fri, 03 Feb 2006 14:07:11 +0200, Brent Clark wrote: > I tried the following: > > $list = values %{ $xmlData->{'misc_links'}->{$linkName}}; > > Which gives me a answer of one, not the correct answer, but its answer > at least for now. Well there you are calling the values() function in scalar

Re: foreach woes

2006-02-03 Thread Brent Clark
Paul Johnson wrote: I've not run any of your code, but: I suspect that turning on strict refs would give you the answer. 'misc_links' => { 'activities_list' => { 'activity' => 'Witbank

Re: foreach woes

2006-02-03 Thread Paul Johnson
On Fri, Feb 03, 2006 at 12:28:21PM +0200, Brent Clark wrote: > Hi all > > I have a problem whereby my foreach will not update a variable ($list) if > the hash has only one key / value. > > Below is my Data Dumper output. > I basically need to do a foreach on > $xmlData->{'misc_links'}->{'activ

foreach woes

2006-02-03 Thread Brent Clark
Hi all I have a problem whereby my foreach will not update a variable ($list) if the hash has only one key / value. Below is my Data Dumper output. I basically need to do a foreach on $xmlData->{'misc_links'}->{'activities_list'}->{'activity'}. Now if I have two or more elements, then its wor