for ( sort keys %data ) { my $pred = join( ', ', @{$data{$_}{pred}} ); print "$_ desc $data{$_}{desc} PRED $pred\n"; }