Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: Hash and count of data values

by bm (Hermit)
on Aug 18, 2003 at 13:45 UTC ( #284568=note: print w/replies, xml ) Need Help??


in reply to Hash and count of data values

print "$item\t$hash{$item}\n";

should probably be something like

foreach (keys %hash) { print "$_\t$hash{$_}\n"; }

Note that you also have two sets of open and close calls in your snippet. Maybe you should look at one open/close with a while(<DATA>) {...} loop that populates your hash.
--
bm

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://284568]
help
Chatterbox?
[Eily]: hello perlmonks :)
[Corion]: choroba: I think it's great that your kids (have to) perform in public - that makes you appreciate any kind of show much better IMO

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (9)
As of 2017-12-12 09:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What programming language do you hate the most?




















    Results (327 votes). Check out past polls.

    Notices?