in reply to Need more elegant solution

for (@reports) { print "section is: $_\n" for split /,/, @{$rpt{$_}}; } for (@reports) { print map { "section is: $_\n" } split /,/, @$rpt{$_}; }