in reply to Re: Please correct my sorting in this HoA
in thread Please correct my sorting in this HoA

Found it:
foreach my $id ( sort keys %HoH ) { print ">$id: \n"; for my $pos ( sort { $a <=> $b } keys $HoH{$id}->%* ) { print "$pos:$HoH{$id}{$pos}\n"; } print "\n";

Replies are listed 'Best First'.
Re^3: Please correct my sorting in this HoA
by Marshall (Canon) on Oct 22, 2022 at 08:55 UTC
    Your syntax looks a bit odd to me. I would code thusly (as personal preference):

    foreach my $id ( sort keys %HoH ) { print ">$id: \n"; for my $pos ( sort { $a <=> $b } keys %{$HoH{$id}} ) { print "$pos:$HoH{$id}{$pos}\n"; } print "\n"; }