Question : perl hash size
Answered by : jacques-kirstein
# Perl
# syntax
keys %<hash-name>
# example
my %weekly_temperature = ( monday => 65, tuesday => 68, wednesday => 71, thursday => 53, friday => 60,
);
my $size = keys %weekly_temperature;
print "Size of hash:" . $size; #[OUTPUT-->Size of hash:5]
Source : | Last Update : Thu, 30 Apr 20