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
: 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
this won't work, will just push one array onto another.
thanks
-Original Message-
From: Shishir K. Singh [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, June 18, 2002 10:55 AM
To: Kipp, James; [EMAIL PROTECTED]
Subject: RE: combining data structures into one array
push (@myVar
-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();
]
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
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
push (@$stats, @$totals, $loads);
didn't work ??
haven't tried yet. get back to you in a bit
thanks again
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Is there a correspondence between stats and totals, such that the
nth entry in stats matches the nth entry in totals? If so,
you would want to say something like:
push @{$stats-[$_]}, @{$totals-[$_]}, @$loads
for 0 .. $#$stats;
no, there is not. i just want to combine the
-Original Message-
From: Kipp, James [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, June 18, 2002 11:46 AM
To: [EMAIL PROTECTED]
Subject: RE: combining data structures into one array
Is there a correspondence between stats and totals, such that the
nth entry in stats matches
],
[ksh, 1.8, 1.2, 3.7, 3.9 ],
etc...
);
thanks.
-Original Message-
From: Shishir K. Singh [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, June 18, 2002 11:04 AM
To: Kipp, James; [EMAIL PROTECTED]
Subject: RE: combining data structures into one array
Oops
, 3.9 ],
etc...
);
thanks.
-Original Message-
From: Shishir K. Singh [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, June 18, 2002 11:04 AM
To: Kipp, James; [EMAIL PROTECTED]
Subject: RE: combining data structures into one array
Oops..your Requirements
On Tuesday, June 18, 2002, at 07:32 , Kipp, James wrote:
I have a subroutine that returns 3 array refs. so i have:
my ($stats, $totals, $loads) = gets_stats();
would it be possible to expose this gets_stats()
function - and/or re-think how it deals with
generating data...
ciao
drieux
: Tuesday, June 18, 2002 12:40 PM
To: [EMAIL PROTECTED]
Subject: RE: combining data structures into one array
Shishir and Bob,
still can't get it to work. also decided we can leave out $loads, so
basically i want to combine $stats and $totals. as bob suggested, here is
sample data:
($stats, $totals
I have a subroutine that returns 3 array refs. so i have:
my ($stats, $totals, $loads) = gets_stats();
would it be possible to expose this gets_stats()
function - and/or re-think how it deals with
generating data...
of course, that is what i am doing now :-).
--
To unsubscribe,
@stats = (user, cpu, mem, tot_cpu, tot_mem, load1, load2);
You can do this
#
my @myVars = ();
push (@myVars, @$stats, @$totals, $loads);
##
tried that, it does not work. I think i have found a way
- Original Message -
From: Kipp, James [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, June 18, 2002 11:40 AM
Subject: RE: combining data structures into one array
Shishir and Bob,
still can't get it to work. also decided we can leave out $loads, so
basically i want to combine
:56 AM
To: 'Shishir K. Singh'; Kipp, James; [EMAIL PROTECTED]
Subject: RE: combining data structures into one array
@stats = (user, cpu, mem, tot_cpu, tot_mem, load1, load2);
You can do this
#
my @myVars = ();
push (@myVars, @$stats, @$totals
On Tuesday, June 18, 2002, at 09:40 , Kipp, James wrote:
$totals = [
[ 15.8, 17.2 ],
[ 3.7, 3.9 ],
etc
];
could it be that this form is like way Ugly?
note that assume a function of form:
# let us Dummy up some data
sub gets_Stats {
my @load = qw/0.1
Thanks everyone for your help. I am going to redo the get_stats() function
to be 'smarter', the way it is now is much to messy.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
well done. but as you said the form is way ugly. I have adjusted the sub
to return array refs that i can easily deal with.
-Original Message-
From: drieux [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, June 18, 2002 1:35 PM
To: begin begin
Subject: Re: combining data structures into one
cool. the 'getRemLoad' sub is going to come in handy during this project
thanks.
then you can unwarp it with say:
http://www.wetware.com/drieux/pbl/Auslanders/gets_stats.txt
ciao
drieux
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL
on Tue, 18 Jun 2002 17:43:24 GMT, James Kipp wrote:
Thanks everyone for your help. I am going to redo the get_stats()
function to be 'smarter', the way it is now is much to messy.
No wonder you come to that conclusion after the odd 20, dare I say,
messy answers in this thread.
Let's go back
On Tuesday, June 18, 2002, at 10:52 , Kipp, James wrote:
well done. but as you said the form is way ugly. I have adjusted the sub
to return array refs that i can easily deal with.
On Tuesday, June 18, 2002, at 09:40 , Kipp, James wrote:
$totals = [
[ 15.8, 17.2 ],
[ 3.7, 3.9 ],
On Tuesday, June 18, 2002, at 10:55 , Kipp, James wrote:
cool. the 'getRemLoad' sub is going to come in handy during this project
thanks.
[..]
then you can unwarp it with say:
http://www.wetware.com/drieux/pbl/Auslanders/gets_stats.txt
You might want to get in touch with
24 matches
Mail list logo