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

There's a number of things you need to do:

Here's my code - it's only minimally changed from yours - check the notes above.

#!perl use 5.12.0; use warnings; my %Hash = ( 'acer.xml' => [], 'tools.xml' => [], 'files.xml' => [ 'organize/file/load.c#6','embark/files/data.c#4' +], 'multimedia.xml' => [], 'extra_for_test.xml' => [ qw{ blahA blahB blahC } ], ); foreach my $key ( keys %Hash ) { next unless @{$Hash{$key}}; my $value = join "\n\t", @{$Hash{$key}}; print "KEY:\t$key\nVALUES:\t$value\n"; }

And here's the output:

$ xml_hash_prob.pl KEY: extra_for_test.xml VALUES: blahA blahB blahC KEY: files.xml VALUES: organize/file/load.c#6 embark/files/data.c#4

-- Ken