Well done for spotting my deliberate mistake ;)
Bugger, Seriously thanks for that, completely forgot [] declares an array
ref in Perl, been writing too much jscript me thinks.
On 10/07/2002 3:56 pm, "Daemmon" <[EMAIL PROTECTED]> wrote:
> On 10 Jul 2002, at 15:32, Mark Cance wrote:
>
>
>> my $hash_tmp =
>> [{name=>"test_n1",discription=>"test_d1"},{name=>"test_n2",discription=>"tes
>> t_d2"},{name=>"test_n3",discription=>"test_d3"}];
>> return
>> {
>> components => $hash_tmp,
>> }
>>
>> Which works, returning the xml below which is close enough;
>>
>>
>> However I�m going to be adding to $hash_tmp in a loop, so to simulate for a
>> quick test I used;
>>
>> push (@hash_tmp,{name=>"test_n1",discription=>"test_d1"});
>> push (@hash_tmp,{name=>"test_n2",discription=>"test_d2"});
>> push (@hash_tmp,{name=>"test_n3",discription=>"test_d3"});
>> return
>> {
>> components => @hash_tmp,
>> }
>>
>
> $hash_tmp is an array reference, which works, while @hash_tmp
> is an array, which won't work.
>
> Try:
> return
> {
> components => \@hash_tmp,
> }
>
> Daemmon
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]