for my $key ( sort keys %hash ) { print "Files for $key:\n"; for my $file ( sort @{ $hash{$key} } ) { print "\t$file\n"; } }