fseng has asked for the wisdom of the Perl Monks concerning the following question:
Hi guys,
I'm just starting learning Perl. Here is my Q.
I want to write a program to read in the following fixed width data file into a data structure of a real array of hashes, the data file for example called "clients" is like following:
I want to write a program to read in the following fixed width data file into a data structure of a real array of hashes, the data file for example called "clients" is like following:
How should I do this?I want to read them in and sorted them in to associated hash where you can find who lives in diff towns or where Chaplin lives etc. I only came up with this so far:Surname L20, First Name L20, Town L20 -------------------------------------------------- Chaplin Charlie Basel Estevez Emilio Santa Manica Sarte Jean Paul Montmarte Rikard Frank Amsterdam Rodin Paul Montmarte
Please help, it's urgent too....open (CL, "clients"); my $list; while (<CL>){ chomp; print "$list\n"; }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: How to read data file into an array of hashes
by toolic (Bishop) on Jun 23, 2009 at 01:15 UTC | |
by fseng (Novice) on Jun 23, 2009 at 02:20 UTC | |
by targetsmart (Curate) on Jun 23, 2009 at 06:29 UTC | |
Re: How to read data file into an array of hashes
by graff (Chancellor) on Jun 23, 2009 at 02:50 UTC | |
by fseng (Novice) on Jun 24, 2009 at 04:43 UTC | |
by graff (Chancellor) on Jun 24, 2009 at 18:02 UTC | |
by fseng (Novice) on Jun 25, 2009 at 06:00 UTC | |
by fseng (Novice) on Jun 26, 2009 at 00:14 UTC | |
Re: How to read data file into an array of hashes
by bichonfrise74 (Vicar) on Jun 23, 2009 at 01:49 UTC |
Back to
Seekers of Perl Wisdom