for my $file (keys %file_contents) { print("File $file:\n"); my $content = $file_contents{$file}; for my $line (@$content) { print($line); } print("\n"); }