Thanks to all that responded with not only an answer, but with a description
of the answer and why my attempt provided the wrong results. People like
you will ensure that people like me are able to learn all those useful, if
sometimes not so obvious commands that Perl has to offer.
Kind Regards
Jason
> -----Original Message-----
> From: Stubbs, Jason [mailto:[EMAIL PROTECTED]]
> Sent: Monday, April 30, 2001 2:37 PM
> To: ActivePerl (E-mail)
> Subject: Counting the number of keys in a Hash of Hashes
>
>
> I'm trying to obtain the number of keys in the referenced
> hash stored in a
> Hash of Hashes. I've tried the following command to print the value:
>
> print $#{keys %{$HoH{$diff_attr} } };
>
> but no matter how many keys there are I always return a value
> of '-1', but I
> know that the referenced hashes have either 1 or 2 keys
> stored. Ultimately,
> I want to test for either condition with an if..then..else statement.
> _______________________________________________
> ActivePerl mailing list
> [EMAIL PROTECTED]
> http://listserv.ActiveState.com/mailman/listinfo/activeperl
>
_______________________________________________
ActivePerl mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/activeperl