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: 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. __

RE: Number of objects in a list

2003-07-25 Thread Raymond Forbes
I am not entirely sure what you are trying to accomplish, but is it something like this? Foreach (keys %hash) { $index++; } print $index; -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Kamal Ahmed Sent: Friday, July 25, 2003 9:15 PM To: 'Acti