in reply to Printing only the "keys that have a value" in hash
for my $key (keys %Hash_filematches) { my $value = $Hash_filematches{$key}; if (scalar @$value) { # check that the arrayref isn't empty print "KEY: $key\n"; print "VALUES: ", join(", ", @$value), "\n\n"; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Printing only the "keys that have a value" in hash
by mjscott2702 (Pilgrim) on Nov 01, 2010 at 10:28 UTC |