in reply to Printing only the "keys that have a value" in hash

Assuming your input always follows the same pattern, and based off of your other replies, you'll want to do something similar to the following (not tested in the least):
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
    ++ for this reply - it's important to check that the arrayref held in the value for each key actually references a non-empty array - otherwise, I'm guessing that the exists call will always return true, since the arrayref will exist, but potentially reference an empty array.