Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Array problems.....

by vinoth.ree (Parson)
on Mar 19, 2013 at 04:58 UTC ( #1024205=note: print w/ replies, xml ) Need Help??


in reply to Array problems.....

Try this too...

use strict; use warnings; use Data::Dumper; my %hash; while(<DATA>) { my ($player,$tableid) = split; if (exists $hash{$tableid}) { push ($hash{$tableid},$player); } else { $hash{$tableid} = [$player]; } } print Dumper \%hash; while(my($tableid,$player) = each(%hash)) { print "\n\nTableid:$tableid\n"; print "\nPlayer:".join("\n",@{$player}); print "\nTotal:". scalar @{$player}; } __DATA__ kapp2cape1111 224 kapp2cape1113 224 kapp2cape1112 224 kapp2cape1111 225 kapp2cape1113 225 kapp2cape1112 225

All is well


Comment on Re: Array problems.....
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (11)
As of 2014-08-21 19:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (143 votes), past polls