develooper Front page | perl.beginners | Postings from May 2007

Building hash record

Thread Next
From:
Rodrick Brown
Date:
May 21, 2007 18:39
Subject:
Building hash record
Message ID:
bb075cdf0705211839j2d10efbdwaa9f76e955efe5ad@mail.gmail.com
I have a few hundred records in a file like the following
a:1
a:2
a:3
b:1
b:2
b:3

I'm trying to build a hash of where the values on the left is the key and
for each value on the right is an array containing the coresponding values I
hope this makes sense

$a{$a} = \@values   where @values = {1,2,3}

I'm trying to do this on one pass if possible.

I'm have a bit of trouble contstructing this kind of data structure if
anyone can help me out it would be appreciated thanks. .


-- 
Rodrick R. Brown
http://www.rodrickbrown.com

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About