Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re^5: Print Max Hash

by johngg (Canon)
on Jan 30, 2018 at 14:46 UTC ( #1208130=note: print w/replies, xml ) Need Help??


in reply to Re^4: Print Max Hash
in thread Print Max Hash

You can't print the total number of occurrences alongside the individual items because you don't know that at the time you print, which is when you see the first of them. However, you could print totals as a summary after you have processed all the records because the %seen hash keeps count for you. Alternatively, defer printing until all records have been read, storing what you want to print as you go in an array (or hash if order is unimportant) that you can tack totals onto at the end of processing.

Cheers,

JohnGG

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (4)
As of 2018-09-24 00:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Eventually, "covfefe" will come to mean:













    Results (191 votes). Check out past polls.

    Notices?
    • (Sep 10, 2018 at 22:53 UTC) Welcome new users!