in reply to How to find length of $hash_ref
Try to find the number of elements in the hash by dereference the hash reference
use strict; use warnings; my %hash=(key1=>'value1',key2=>'value2',key3=>'value4'); my $hash_ref=\%hash; print scalar keys %$hash_ref;
|
|---|