Re: accesing a hash of an array of hashes

2007-05-29 Thread Jenda Krynicky
From: pauld <[EMAIL PROTECTED]> > ive read a load of data in from a CSV file with Text::CSV and ended > up with a hash (%hash) where the keys are the column labels. > my @headings=split(/,/,$rows[0]) > and then > > for (my $j=1;$j<$#rows;$j++) > { > my $status = $csv->parse ($rows[$j]); # par

Re: accesing a hash of an array of hashes

2007-05-28 Thread Paul Lalli
On May 27, 4:37 pm, [EMAIL PROTECTED] (Pauld) wrote: > thanks for the help - im looking up hash slices - perldoc perldata Entire arrays (and slices of arrays and hashes) are denoted by '@', which works much like the word "these" or "those" does in English, in that it indicates mult

Re: accesing a hash of an array of hashes

2007-05-28 Thread pauld
thanks for the help - im looking up hash slices - but id like to get something that works and then i can add new ideas etc so im going to leave it as it for the time being. Data::Dumper has helped sort out where an error is coming #!/usr/bin/perl -w use strict; use warnings; open O, "<$file" or

Re: accesing a hash of an array of hashes

2007-05-26 Thread Paul Lalli
On May 26, 1:51 pm, [EMAIL PROTECTED] (Mumia W.) wrote: > On 05/26/2007 07:17 AM, pauld wrote: > > > ive read a load of data in from a CSV file with Text::CSV and ended > > up with a hash (%hash) where the keys are the column labels. > > my @headings=split(/,/,$rows[0]) > > and then > > > for (my

Re: accesing a hash of an array of hashes

2007-05-26 Thread Mumia W.
On 05/26/2007 07:17 AM, pauld wrote: ive read a load of data in from a CSV file with Text::CSV and ended up with a hash (%hash) where the keys are the column labels. my @headings=split(/,/,$rows[0]) and then for (my $j=1;$j<$#rows;$j++) { my $status = $csv->parse ($rows[$j]); # parse a CSV

Re: accesing a hash of an array of hashes

2007-05-26 Thread yaron
From: [EMAIL PROTECTED] To: "pauld" <[EMAIL PROTECTED]> Cc: "beginners" Sent: 19:47:38 (GMT+0200) Africa/Harare שבת 26 מאי 2007 Subject: Re: accesing a hash of an array of hashes Hi, To access element of a given DATE (sat ... date_inp) from Hofdates you can do the following

Re: accesing a hash of an array of hashes

2007-05-26 Thread yaron
Hi, To access element of a given DATE (sat ... date_inp) from Hofdates you can do the following: my $date_inp = ... ; die "No etries for date $date_inp" unless (exists $Hofdates{$date_inp} and @{$Hofdates{$date_inp}}); foreach my $hash_ref (@{$Hofdates{$date_inp}}) { while (my ($field,$va

Re: accesing a hash of an array of hashes

2007-05-26 Thread Paul Lalli
On May 26, 8:17 am, [EMAIL PROTECTED] (Pauld) wrote: > ive read a load of data in from a CSV file with Text::CSV and ended > up with a hash (%hash) where the keys are the column labels. > my @headings=split(/,/,$rows[0]) You're use()'ing Text::CSV, but you're not actually using Text::CSV. Why?