On 1/27/06, Jeff Pang <[EMAIL PROTECTED]> wrote:
> Hello,Chas,
>
> Thanks advanced for your good suggestions.
> I tidy up all the words said by you,and write the code as following.Is it
> right?
>
> while(<$sock>)
> {
> my ($key,$value) = split;
> my $timestamp = time();
> push @recor
ng() if $sum{$_} > LIMIT;
}
}
-Original Message-
>From: Chas Owens <[EMAIL PROTECTED]>
>Sent: Jan 27, 2006 11:14 PM
>To: Jeff Pang <[EMAIL PROTECTED]>
>Cc: beginners@perl.org
>Subject: Re: count in continuous time piece
>
>On 1/27/06, Jeff Pang <[EMAIL PROTECT
On 1/27/06, Chas Owens <[EMAIL PROTECTED]> wrote:
> for (@records) {
> delete $_ if $_->{time} < time() - 5*60;
> }
Oops, I misused the delete() function. I needed to use the shift()
function instead:
shift @records while $records[0]{time} < time() - 5*60;
--
To unsubscribe, e-mail: [EMAIL
On 1/27/06, Jeff Pang <[EMAIL PROTECTED]> wrote:
> Now I'm still confused on this work.Maybe I have not described the problem
> clearly.
> Fox example,there are some items coming in continuous time piece:
>
> 00:00:01 itemA 200
> 00:00:02 itemB 100
> 00:00:03 itemC 150
> 00:00:04 itemD 300
cal record out of 5 minutes
relative the current time
}
}
How can I do it?Any suggestion is welcome.Thanks.
-Original Message-
>From: Chas Owens <[EMAIL PROTECTED]>
>Sent: Jan 24, 2006 9:47 AM
>To: Jeff Pang <[EMAIL PROTECTED]>
>Cc: beginners@perl.org
>
On 1/24/06, Jeff Pang <[EMAIL PROTECTED]> wrote:
> hi,lists,
> I want to do this work: count something in continuous given time piece,such
> as 10
> minutes.Fox example,there are the lines coming to the socket server as
> following:
>
> 1_feifish1_01_1000ybyg:11530514:get
> 1_swm_mail_01_100k8qte
hi,lists,
I want to do this work: count something in continuous given time piece,such as
10 minutes.Fox example,there are the lines coming to the socket server as
following:
1_feifish1_01_1000ybyg:11530514:get
1_swm_mail_01_100k8qte:13901448:get
1_dajia###_01_1006x8jh:11652267:put
...
each line