Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Question on updating a hash table

by toolic (Bishop)
on Mar 25, 2016 at 20:48 UTC ( [id://1158805]=note: print w/replies, xml ) Need Help??


in reply to Question on updating a hash table

I think you want to push:
use warnings; use strict; use Data::Dumper; $Data::Dumper::Sortkeys=1; my %data; while (<DATA>) { chomp; my @ju = split; push @{ $data{$ju[0]} }, { event => $ju[1], month => $ju[2], am => $ju[3], pm => $ju[4], } } print Dumper(\%data); __DATA__ OA322 U383 Mar 3.84 2.44 OA322 U982 Dec 2.57 1.83 OA322 U946 May 2.87 1.35 OA322 U823 Dec 6.61 4.08 OA322 U590 Aug 8.19 9.62 OA322 U19 Jul 9.93 9.23 BD110 U144 Apr 4.22 4.93 BD110 U848 Dec 1.72 7.30 BD110 U498 Jun 6.88 8.72 BD110 U606 Sep 5.54 9.86 BD110 U16 Jul 6.47 7.67 BD110 U160 Sep 7.21 4.12 BD110 U572 Jul 2.60 6.86 BD110 U804 Jul 0.04 9.71 RF858 U261 Jan 5.69 1.64 RF858 U731 Sep 9.45 7.13 RF858 U551 Jan 4.67 6.40 RF858 U888 Dec 7.22 4.20 VS524 U509 Jan 5.94 9.46 VS524 U14 Aug 5.22 1.78 MN739 U710 Jul 3.98 1.83

See also:

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (2)
As of 2024-04-25 20:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found