in reply to Need more elegant solution

If your data should be ordered, than you simply use an multidimensional array over a hash:
my @reports = ( [doc_request => [qw(T_Doc_Request N_Doc_Request X_Doc_Request)]], [doc_errors => [qw(T_Doc_Errors N_Doc_Errors X_Doc_Errors )]], [doc_types => [qw(T_Doc_Types N_Doc_Errors X_Doc_Errors )]], ); for (@reports) { my $report = $_->[0]; for my $section (@{$_->[1]}) { print qq{report '$report', section '$section'\n}; } }

Replies are listed 'Best First'.
Re^2: Need more elegant solution
by TomDLux (Vicar) on Feb 26, 2011 at 02:53 UTC

    Great suggestion, other than there only being a multi-dimensional array, no hash component.

    As Occam said: Entia non sunt multiplicanda praeter necessitatem.