Re: Number of objects in a list

2003-07-26 Thread $Bill Luebkert
Kamal Ahmed wrote: > Hi Perl Group, > How can I get number of objects in a hash ? perlfaq4: How can I know how many entries are in a hash? If you mean how many keys, then all you have to do is take the scalar sense of the keys() function: $num_keys = scalar keys %hash; Th

RE: Program Enhancement / String Addition in output

2003-07-26 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Kamal Ahmed wrote: > Dear List, > > I have the following program and also the data on which this works. > > I want to know: > > 1. What does the line > $hash{$1}+=$2 if(m/^Time\s+(\d+)\s+Count\s+(\d+)/); > means It takes the digits found after Time and uses that as a key into the $hash

Program Enhancement / String Addition in output

2003-07-26 Thread Kamal Ahmed
Dear List, I have the following program and also the data on which this works. I want to know: 1. What does the line $hash{$1}+=$2 if(m/^Time\s+(\d+)\s+Count\s+(\d+)/); means 2. The line printf "$sec - %d\n", $hash{$sec}; prints out xx - yy where xx = Seconds elapsed and yy - Total Count per th

RE: Number of objects in a list

2003-07-26 Thread Bullock, Howard A.
$count = scalar (keys %hash); -Original Message- From: Kamal Ahmed [mailto:[EMAIL PROTECTED] Sent: Saturday, July 26, 2003 12:15 AM To: 'ActivePerl mailing list' Subject: Number of objects in a list Hi Perl Group, How can I get number of objects in a hash ? Thanks, Kamal. __