http://www.perlmonks.org?node_id=993791


in reply to Re^2: Counting how many times item is occurring and adding the total from array help!
in thread Counting how many times item is occurring and adding the total from array help!

Easy! replace the last two lines by:
say "Account $_ - occurring $accounts{$_}->[1] time(s) - Total = $acco +unts{$_}->[0]" for keys %accounts; say "Grand Total = $g_total";

CountZero

A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James

My blog: Imperial Deltronics

Replies are listed 'Best First'.
Re^4: Counting how many times item is occurring and adding the total from array help!
by Anonymous Monk on Sep 15, 2012 at 12:07 UTC
    Great help, thanks a lot!!!! On my way to code some more now!!!