Do you mean to say 

push (@$stats, @$totals, $loads);

didn't work ??

-----Original Message-----
From: Kipp, James [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, June 18, 2002 11:23 AM
To: Shishir K. Singh; Kipp, James; [EMAIL PROTECTED]
Subject: RE: combining data structures into one array


> I am assuming User, cpu, mem, tot_cpu, tot_mem are again 
> reference to an array


woops let me clarify. $stats is a ref to an array of anon arrays.
so '$stats->[0]' contains a record lie ["someuser", 5.5, 10.2]
same goes for $totals
$loads just refs a single anon array: $loads = [load1, load2]

thanks


> 
> Cheers 
> Shihir
>  
> 
> -----Original Message-----
> From: Shishir K. Singh 
> Sent: Tuesday, June 18, 2002 10:55 AM
> To: Kipp, James; [EMAIL PROTECTED]
> Subject: RE: combining data structures into one array
> 
> 
> push (@myVar, @$_) for @$stats;
> push (@myVar, @$_) for @$totals;
> push (@myVar, $_)  for @$loads; 
> 
> 
> 
> 
> -----Original Message-----
> From: Kipp, James [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, June 18, 2002 10:32 AM
> To: [EMAIL PROTECTED]
> Subject: combining data structures into one array
> 
> 
> I have a subroutine that returns 3 array refs. so i have:
> my ($stats, $totals, $loads) = gets_stats();
> $stats and $totals are reference to arrays of arrays. $loads 
> is just a ref
> to an array. what i want to do is is combine each "record" of 
> each array
> into one. here is how the structures look:
> $stats -> @array -> [user, cpu, mem] 
> $totals -> @array -> [tot_cpu, tot_mem]
> $loads -> [load1, load2]
> 
> so i would like to itereate through the records of each of 
> these arrays and
> end up with 
> @stats = [ user, cpu, mem, tot_cpu, tot_mem, load1, load2]
> [ ..another record...] 
> [ ..another record...] ...etc....
> 
> I have tried a few things, but no luck.
> 
> Thanks
> Jim
> 
> 
> 
> 
> 
> -- 
> 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]
> 
> 


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to