in reply to Arrays and Hashes woes

%tmpF->{ID}=@tmpA; push(@$fieldobj,%tmpF);

I suppose you need array/hash references (note the \ operator):

$tmpF{ID} = \@tmpA; push(@$fieldobj, \%tmpF);

(Also, the %tmpF->{ID} should be $tmpF{ID})

Replies are listed 'Best First'.
Re^2: Arrays and Hashes woes
by TienLung (Acolyte) on Mar 16, 2009 at 11:30 UTC
    Many thanks, using references solved the problem. I note that using:
    %tmpF->{ID}
    and
    $tmpD{ID}
    seems to make no difference, both work. What are your reasons for suggesting the bottom way over the top way? I am not trying to say you are wrong! far from it, I just want to know why you would do it that way :) TienLung

      The former syntax is deprecated (and rather unusual):

      $ perl -w -e "%tmpF->{ID} = 'foo'" Using a hash as a reference is deprecated at -e line 1.