Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re^3: Please correct my sorting in this HoA

by Marshall (Canon)
on Oct 22, 2022 at 08:55 UTC ( [id://11147594]=note: print w/replies, xml ) Need Help??


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

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"; }

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11147594]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (4)
As of 2024-04-25 16:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found